Moving shape with arrow keys
Hello,
How would I click on one of the circles I've created and move them using the arrow keys. The circles move just fine with the drag of the mouse but now I want to use the arrow keys. Can somebody help me please? I would really appreciate the assistance.
Michael
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DragBallPanel extends JPanel implements MouseListener, MouseMotionListener, KeyListener
private static final int BALL_DIAMETER = 50; // Diameter of ball
private static final int BALL_DIAMETER2 = 50;
//--- instance variables
/** Ball coords. Changed by mouse listeners. Used by paintComponent. */
private int _ballX = 50; // x coord - set from drag
private int _ballY = 50; // y coord - set from drag
private int x2 = 200; // starting x coord for 2nd ball
private int y2 = 200; //starting y coord for 2nd ball
private int x3 = 75;
private int y3 = 150;
/** Position in ball of mouse press to make dragging look better. */
private int _dragFromX = 0; // pressed this far inside ball's
private int _dragFromY = 0; // bounding box.
private int xInsideBall = 0; //coordinates of where the mouse is pressed inside second ball
private int yInsideBall = 0; //is pressed inside second ball
private int x3InsideBall = 0; //coordinates of where the mouse is pressed inside second ball
private int y3InsideBall = 0; //is pressed inside second ball
/** true means mouse was pressed in ball and still in panel.*/
private boolean _canDrag = false;
private boolean _canDrag2 = false;
private boolean _canDrag3 = false;
/** Constructor sets size, colors, and adds mouse listeners.*/
public DragBallPanel()
setPreferredSize(new Dimension(400, 400));
setBackground(Color.ORANGE);
setForeground(Color.BLUE);
//--- Add the mouse listeners.
this.addMouseListener(this);
this.addMouseMotionListener(this);
}//endconstructor
/** Ball is drawn at the last recorded mouse listener coordinates. */
public void paintComponent(Graphics g)
super.paintComponent(g); // Required for background.
g.fillOval(_ballX, ballY, BALLDIAMETER, BALL_DIAMETER);
g.setColor(Color.RED);
g.fillOval(x2, y2, BALL_DIAMETER2, BALL_DIAMETER2);
g.setColor(Color.BLACK);
g.fillOval(x3, y3, BALL_DIAMETER2, BALL_DIAMETER2);
}//end paintComponent
public void mousePressed(MouseEvent e)
int x = e.getX(); // Save the x coord of the click
int y = e.getY(); // Save the y coord of the click
if (x >= ballX && x <= (ballX + BALL_DIAMETER)
&& y >= ballY && y <= (ballY + BALL_DIAMETER))
_canDrag = true;
dragFromX = x - ballX; // how far from left
dragFromY = y - ballY; // how far from top
else
_canDrag = false;
//clicked on 2nd ball
if(x >= x2 && x <= (x2 + BALL_DIAMETER2)
&& y >= y2 && y <= (y2 + BALL_DIAMETER2) )
_canDrag2 = true;
xInsideBall = x - x2;
yInsideBall = y - y2;
else
_canDrag2 = false;
if(x >= x3 && x <= (x3 + BALL_DIAMETER2)
&& y >= y3 && y <= (y3 + BALL_DIAMETER2) )
_canDrag3 = true;
x3InsideBall = x - x3;
y3InsideBall = y - y3;
else
_canDrag3 = false;
}//end mousePressed
public void mouseDragged(MouseEvent e)
// True only if button was pressed inside ball.
//--- Ball pos from mouse and original click displacement
if (_canDrag)
ballX = e.getX() - dragFromX;
ballY = e.getY() - dragFromY;
//--- Don't move the ball off the screen sides
ballX = Math.max(ballX, 0);
ballX = Math.min(ballX, getWidth() - BALL_DIAMETER);
//--- Don't move the ball off top or bottom
ballY = Math.max(ballY, 0);
ballY = Math.min(ballY, getHeight() - BALL_DIAMETER);
this.repaint(); // Repaint because position changed.
if (_canDrag2)
x2 = e.getX() - xInsideBall;
y2 = e.getY() - yInsideBall;
x2 = Math.max(x2, 0);
x2 = Math.min(x2, getWidth() - BALL_DIAMETER2);
y2 = Math.max(y2, 0);
y2 = Math.min(y2, getHeight() - BALL_DIAMETER2);
this.repaint(); // Repaint because position changed.
if (_canDrag3)
x3 = e.getX() - x3InsideBall;
y3 = e.getY() - y3InsideBall;
x3 = Math.max(x3, 0);
x3 = Math.min(x3, getWidth() - BALL_DIAMETER2);
y3 = Math.max(y3, 0);
y3 = Math.min(y3, getHeight() - BALL_DIAMETER2);
this.repaint(); // Repaint because position changed.
}//end mouseDragged
public void keyPressed(KeyEvent ke)
//int x = e.getX(); // Save the x coord of the click
//int y = e.getY(); // Save the y coord of the click
int dx = 10;
switch (ke.getKeyCode())
case KeyEvent.VK_LEFT: // move x coordinate left
_ballX -= dx;
ballX = Math.max(ballX, 0);
break;
case KeyEvent.VK_RIGHT: // move x coordinate right
_ballX += dx;
ballX = Math.min(ballX, getWidth() - BALL_DIAMETER);
this.repaint();
public void mouseMoved (MouseEvent e) {} // ignore these events
public void mouseEntered (MouseEvent e) {} // ignore these events
public void mouseClicked (MouseEvent e) {} // ignore these events
public void mouseReleased(MouseEvent e) {} // ignore these events
public void mouseExited (MouseEvent e) {} // ignore these events
public void keyReleased (KeyEvent ke) {} // ignore this junk
public void keyTyped (KeyEvent ke) {} // ignore this junk
}//endclass DragBallPanel
A couple of notes:
- That code did not add the keyListener to anything.
- At the moment (in the altered code below), only the blue circle moves, and only left/right. It is left as an exercise to the OP to 'take it from there'.
- It only took four more lines of code to turn that code into an SSCCE*, which will generally get more help.
- Please use code indentation, and the code formatting delimiters, when posting code. It makes code a lot easier to read and understand.
* The SSCCE is described at..
<http://www.physci.org/codes/sscce.html>
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DragBallPanel extends JPanel
implements MouseListener, MouseMotionListener, KeyListener
private static final int BALL_DIAMETER = 50; // Diameter of ball
private static final int BALL_DIAMETER2 = 50;
//--- instance variables
/** Ball coords. Changed by mouse listeners. Used by paintComponent. */
private int _ballX = 50; // x coord - set from drag
private int _ballY = 50; // y coord - set from drag
private int x2 = 200; // starting x coord for 2nd ball
private int y2 = 200; //starting y coord for 2nd ball
private int x3 = 75;
private int y3 = 150;
/** Position in ball of mouse press to make dragging look better. */
private int _dragFromX = 0; // pressed this far inside ball's
private int _dragFromY = 0; // bounding box.
private int xInsideBall = 0; //coordinates of where the mouse is pressed inside second ball
private int yInsideBall = 0; //is pressed inside second ball
private int x3InsideBall = 0; //coordinates of where the mouse is pressed inside second ball
private int y3InsideBall = 0; //is pressed inside second ball
/** true means mouse was pressed in ball and still in panel.*/
private boolean _canDrag = false;
private boolean _canDrag2 = false;
private boolean _canDrag3 = false;
/** Constructor sets size, colors, and adds mouse listeners.*/
public DragBallPanel()
setPreferredSize(new Dimension(400, 400));
setBackground(Color.ORANGE);
setForeground(Color.BLUE);
//--- Add the mouse listeners.
this.addMouseListener(this);
this.addMouseMotionListener(this);
// add the keylistener!
this.addKeyListener(this);
// make sure the panel is focusable
setFocusable(true);
}//endconstructor
/** Ball is drawn at the last recorded mouse listener coordinates. */
public void paintComponent(Graphics g)
super.paintComponent(g); // Required for background.
g.fillOval(_ballX, _ballY, BALL_DIAMETER, BALL_DIAMETER);
g.setColor(Color.RED);
g.fillOval(x2, y2, BALL_DIAMETER2, BALL_DIAMETER2);
g.setColor(Color.BLACK);
g.fillOval(x3, y3, BALL_DIAMETER2, BALL_DIAMETER2);
}//end paintComponent
public void mousePressed(MouseEvent e)
int x = e.getX(); // Save the x coord of the click
int y = e.getY(); // Save the y coord of the click
if (x >= _ballX && x <= (_ballX + BALL_DIAMETER)
&& y >= _ballY && y <= (_ballY + BALL_DIAMETER))
_canDrag = true;
_dragFromX = x - _ballX; // how far from left
_dragFromY = y - _ballY; // how far from top
else
_canDrag = false;
//clicked on 2nd ball
if(x >= x2 && x <= (x2 + BALL_DIAMETER2)
&& y >= y2 && y <= (y2 + BALL_DIAMETER2) )
_canDrag2 = true;
xInsideBall = x - x2;
yInsideBall = y - y2;
else
_canDrag2 = false;
if(x >= x3 && x <= (x3 + BALL_DIAMETER2)
&& y >= y3 && y <= (y3 + BALL_DIAMETER2) )
_canDrag3 = true;
x3InsideBall = x - x3;
y3InsideBall = y - y3;
else
_canDrag3 = false;
}//end mousePressed
public void mouseDragged(MouseEvent e)
// True only if button was pressed inside ball.
//--- Ball pos from mouse and original click displacement
if (_canDrag)
_ballX = e.getX() - _dragFromX;
_ballY = e.getY() - _dragFromY;
//--- Don't move the ball off the screen sides
_ballX = Math.max(_ballX, 0);
_ballX = Math.min(_ballX, getWidth() - BALL_DIAMETER);
//--- Don't move the ball off top or bottom
_ballY = Math.max(_ballY, 0);
_ballY = Math.min(_ballY, getHeight() - BALL_DIAMETER);
this.repaint(); // Repaint because position changed.
if (_canDrag2)
x2 = e.getX() - xInsideBall;
y2 = e.getY() - yInsideBall;
x2 = Math.max(x2, 0);
x2 = Math.min(x2, getWidth() - BALL_DIAMETER2);
y2 = Math.max(y2, 0);
y2 = Math.min(y2, getHeight() - BALL_DIAMETER2);
this.repaint(); // Repaint because position changed.
if (_canDrag3)
x3 = e.getX() - x3InsideBall;
y3 = e.getY() - y3InsideBall;
x3 = Math.max(x3, 0);
x3 = Math.min(x3, getWidth() - BALL_DIAMETER2);
y3 = Math.max(y3, 0);
y3 = Math.min(y3, getHeight() - BALL_DIAMETER2);
this.repaint(); // Repaint because position changed.
}//end mouseDragged
public void keyPressed(KeyEvent ke)
System.out.println("key PRESSED");
//int x = e.getX(); // Save the x coord of the click
//int y = e.getY(); // Save the y coord of the click
int dx = 10;
switch (ke.getKeyCode())
case KeyEvent.VK_LEFT: // move x coordinate left
_ballX -= dx;
_ballX = Math.max(_ballX, 0);
break;
case KeyEvent.VK_RIGHT: // move x coordinate right
_ballX += dx;
_ballX = Math.min(_ballX, getWidth() - BALL_DIAMETER);
this.repaint();
public void mouseMoved (MouseEvent e) {} // ignore these events
public void mouseEntered (MouseEvent e) {} // ignore these events
public void mouseClicked (MouseEvent e) {} // ignore these events
public void mouseReleased(MouseEvent e) {} // ignore these events
public void mouseExited (MouseEvent e) {} // ignore these events
public void keyReleased (KeyEvent ke) {} // ignore this junk
public void keyTyped (KeyEvent ke) {} // ignore this junk
/** Add a main(), to make this an SSCCE. */
public static void main(String[] args) {
DragBallPanel dbp = new DragBallPanel();
JOptionPane.showMessageDialog(null, dbp);
}//endclass DragBallPanel
Similar Messages
-
Artifacts when moving object with arrow keys.
Hi all
hope this is the right place to post this question.
I want to to write simple arkanoid game in Flash (AC3). I've managed to write code that moves my paddle with arrow keys. The code looks like this:
function OnNewFrame(event:Event):void
if (input.IsLeftHeld)
if (paddle.x > 0)
paddle.x -= 10;
else
if (input.IsRightHeld)
if (paddle.x < stage.stageWidth - paddle.width)
paddle.x += 10;
It works but the result is ugly. The animation is not fluent, there are times when paddle stops for a moment . Also when speed of translation is high (here it is 10) you can see that paddle is flickering at the ends, it looks like single buffering problem. You can see both of those effects here: http://www.flash-game-design.com/flash-tutorials/movOb.html , hovewer flickering is less visible due to small translation amount.
How to fix this? How can i enable double buffering (or maybe it is enabled by default)? Any help will be appreciated.
P.S. sorry for bad englishThanks for samples, this is very kind ; p
Hovewer you are doing everything almost exactly as I'am doing. Tou are using mySymbol.x++ which means your translation speed is 1. Also I'am aware that rising frame rate will result in smoother animations, but this is not the point. So once again, my flash applications suffer from two problems:
1) Animations are not smooth. You can see this crealrly in here: http://www.kirupa.com/developer/actionscript/hittest.htm , go back to the very bottom of the page, there is an animation window, look at the smallest circle. It looks like its blinking.
2) Moving symbols with arrow keys with the method i've presnted in the first post (the same method that infeter uses ). Moved symbol is randomly stopping for the very (very very) short amount of time. You can easily spot this in infeter sample.
Many sample applications i've seen suffer from those issues. and nobody seems to see the problem, so maybe I am delusional? ; p
cheers and thank for help -
Moving Sprite with arrow keys, simultaneous directions
Hi everyone.
I'm trying to create a small arcade style game, you control a
small ship, shoot at incoming targets, try to dogde their shots,
etc. I'm working on the ship's movement right now, using the arrow
keys to control it. Getting it to move one direction at a time is
easy, but sometimes I need to move it diagonally, otherwise I think
gameplay will suffer considerably.
I have tried several things but I never seem to be able to
tell Flash that two keys are being pressed simultaneously. Can
anyone tell me how I might achieve this?
Thank you.This format should allow detection of multiple keys at once:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(ev:KeyboardEvent):void {
var pressedKey:uint = ev.keyCode;
if(pressedKey == Keyboard.LEFT) {
leftDown = true;
if(pressedKey == Keyboard.RIGHT) {
rightDown = true;
if(pressedKey == Keyboard.UP) {
upDown = true;
if(pressedKey == Keyboard.DOWN) {
downDown = true;
ship.addEventListener(Event.EnterFrame, moveShip);
} -
Moving anchor point with arrow keys crashes Photoshop CC
Hey guys,
I've recently run into this bug many times while working with shapes. Don't really know what initiates it but it's super annoying as it crashes the PS CC completely without possiblity of recovering the unsaved files.
The bug appears while working with shapes after file is saved and reopened. Because I use to design pixel-perfect UIs, I work with arrow keys a lot to be sure every pixel is in the right place. So after selecting one or more anchor points of shape and hitting any arrow key (to move it by pixel), photoshop immediately crashes with this super-long description of bug: http://justpaste.it/ccshapecrash
Dunno why but this occurs very often when handling 1px-thin rectangles.
Is it only me or has anybody else experienced this as well? Any idea what exactly is causing it or what might be wrong with my config?
Never seen that kind of error in Photoshop before. It completely destroys my everyday workflowI have exactly the same problem and I don't have any solution. I was tried to update the latest video drivers - nothing! Tried to update Photoshop which updates fixes bugs - nothing! The problem continues.
My OS is Windows 8 64bit, video card Nvidia GT 630. For the case, my Photoshop 32x works better (faster) than the 64x. Why is that ? I hope to have a solution. -
How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting. -
Can't move an object with arrow keys - CS3
In Fash CS3, suddenly, in certain files, I can't move an object left using arrow keys - but I can move the same object right, or if I hold down Shift + left arrow, it works correctly
Also - I can move the object down with arrow keys, but not up
Workaround - move an object on a different layer, then return to the problem object and it moves correctly. But this doesn't last long, the problem resurfaces.
Does anyone have a solution for this? (I've tried rebooting; tried copying all the layers into a new file - no help.)Now, working in the same file, I just clicked on a stroke and it changed the stroke from a smooth curve to angular lines.
I suspect this file is corrupt. Any thoughts on how to salvage the weeks of work that have gone into it? Every version of this file has the same issues.
Thanks for any help. -
How to make a first-person style game with arrow key movement?
Hey guys, I've made some simple click-to-move 1st person games with AS3, but I just wanted to know if there was a way to move around in 1st person with arrow keys, I was thinking you could get the background to move with the arrow keys, but that would be a little confusing.
If you guys have any suggestions for me, or if it's possible, please reply! ThanksHere is a basic switch usage to move something with the keyboard:
stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
function move_mc(event:KeyboardEvent):void {
switch(event.keyCode)
case Keyboard.LEFT : mc.x -= 5
break;
case Keyboard.RIGHT : mc.x += 5
break;
case Keyboard.UP : mc.y -= 5
break;
case Keyboard.DOWN : mc.y += 5
break; -
Premiere CC Frame stepping with arrow keys
Why can I no longer step ahead or back one frame at a time with arrow keys after updating PremiereCC software?
It's working here for me xAndyx. Can you try trashing preference? Press Shift + Option and restart Premiere Pro (warning: you'll use any custom kb shortcuts, workspaces, etc.).
Thanks,
Kevin -
Deisgn - Objects stop moving with arrow keys until a relaunch
In design mode, CR 2008, line objects and other design objects stop moving with the arrow keys and won't move more than one position until I either click on the object again and move it one position or I exit CR and relaunch that report. If I move a field object, and go back to a line or other graphic object, it will begin moving with the arrow keys again.
I have a dual monitor setup and wonder if that is my problem.
Thank you.Hello,
Yes that is likely the problem. CR doesn't support dual monitors. Watch out for our Pop-ups, they may get hidden popping up on the other monitor behind another form.
Thank you
Don -
Having trouble with arrow keys and moving objects
All of a sudden I can't move objects in Illustrator (CS4). They move around in a jerky fashion and make big jumps with the arrow keys. I tried restarting, resetting preferences, playing with mouse. What could be causing this and how can I fix it?
View->snap to grid?
-
Moving a line with arrow keys/can't adjust distance
In Illustrator CS6 I can't adjust how far a line moves when I move it using the arrow keys. I've gone to Preferences>General>Keyboard Increment and changed the amount, but the line moves the same distance no matter what I put in. Neither Snap to Grid nor Snap to Point are turned on.
Thank you Mike! It was driving me crazy. I just started to use CS6 and hadn't messed with any adjustments. How would someone know to check such a seemingly obscure--except to come to the forum?
-
Labview 2009 SP1 crashes when moving large selection with arrow key
If I select a lot (10 or 15) of Block Diagram components and try to move them some distance with the arrow key, I will frequently get a program crash. Since a smaller number of components seems to crash after a longer travel distance, it looks like some kind of buffer overflow error. I do not see this problem when using the mouse to move selections.
I have checked to be sure I have the latest video driver for my NVIDIA Quatro FX570. I have also tried working with no hardware acceleration and no combined writes. This is happening on Windows XP SP3 with all the current updates.
It has become so bad that I have to do a Save As every fifteen minutes to keep from losing data.
Why don't I use my mouse for all movements? Because it is not as accurate and not so easy to restrict to one dimension of movement. My hand is not as steady as it once was.
I hoping someone will have a suggestion that will clear up this problem.
Solved!
Go to Solution.As I indicated, I had the same problem with 8.5 and just DID a new installation of Labview 2009.
Since it is possible my three-monitor setup, which obviously requires more video memory, may be at the root of the problem, I am satisfied with the workaround of dragging the objects near their final destination and then using the arrow keys.
Three monitors are ideal for front panel, block diagram and Help/Internet/Probe Window. When I had to work in the field with only one monitor, I felt severely handicapped.
You may consider the matter closed.
Thanks for attempting to duplicate the failure. -
Moving Movie Clips with Arrow keys
How do i make it so when i click the left arrow key, it will
change the movie clip to make it turn around?Yes, that's what the code I gave you is intended to do....
you replace that code with whatever action you need to take to turn
your movie around.
I have no idea what your movieclip is doing, but I'm guessing
by your response that if it was an arrow pointing left to right
(just an example), you want it to be pointing right to left when
the left arrow is pressed. If you want an immediate turn around,
then the simplest way to do that is to have another frame
containing the movieclip that it moves to where it faces the other
direction--and to have it appear turned around, from the toolbar
you select Modify -> Transform -> Flip Horizontal.
So the movieclip would live inside another movieclip that has
two frames with stop()'s for each frame. In the first frame you
would have the subclip facing left to right, and in the second you
would have it facing right to left. If we call that 2-framed
movieclip "walker", the code I provided before would
become... -
Moving Identity Plate with Arrow Keys
I have always been able to move my identity plate around using the arrow keys. For some reason, it doesn't work any more. I am using Lightroom 2.3. I know that this is a small problem, but I sure would like to know how to remedy this. Thanks!
Hi Ken,
This is how I have done it.
1. Create identity plate in Illustrator and save as an Illustrator file = .ai
2. Go to Overlays in Lightroom and check Identity Plate
3. Within the Identity Plate checkered box, you will see a pull-down menu on the bottom right
4. Select Edit
5. Select the radio button: "Use a graphical Identity Plate"
6. Locate the ai file and select Choose (You might not see anything in the window, but don't worry about that
7. Select Custom
8. Choose Save As and give it a name
9. Select OK
Now, when you go into that checkered box within the Identity Plate window, you will now see your new Identity Plate (ai graphic) listed. Select it, and it will be displayed on your photograph. Sometimes, I have to select it twice (not sure why) for the resolution to be high quality. Good luck and let me know how it works out.
Matt -
Problem with arrow keys in some tools
So, as most of you know, you can use the arrow keys on your keyboard to change the corner radius of some tools, to add or remove segments of the spiral shape etc. One tap should adjust your tool settings in fine increments. But in my case when i tap on the arrow key it makes huge changes. The same thing is with the "C", "X", "F", "V". So i can't use these tools properly. Does someone know how to deal with this issue? Thanks in advance!
Yes, i'm using latest Wacom Bamboo Fun.
I just tried to use my MacBook's touchpad instead of tablet and arrow keys work fine. That confirms the Wacom Tablet bug. It's kinda strange that there's no discussions anywhere on this topic. Hope there will be a solution soon. So now i'll have to use touchpad when i work in Illustrator. Thank you for your answer, it helped.
Maybe you are looking for
-
Active Directory accounts problem logging in to Mavericks
We have twenty iMacs in a lab and five in an Internet café, all wired to a multiple subnet network. OS X Mavericks is bound to Active Directory. Frequently OS X Mavericks behaves as if the network user account password is entered incorrectly until t
-
Can't see time machine drive and can't boot
Last week the internal hd on my Mac mini (mid-2010) began failing. I took it in and AppleCare replaced the drive. The genius told me they loaded 10.7.3 and I should be able to use Time Machine (TM) to bring it all back. So I go home, plug in my TM dr
-
Google maps not working with symbian belle upgrade
guys after recent upgrade with symbian belle google maps stopped working is there any problem will belle dose it support google maps 4.1.1
-
WPF WebBrowser Control Security Message After Loading Local XML File
When I use the .Source property of the WebBrowser control, it displays the XML file I pointed to, but then puts a security banner at the top, stating that some content has been disabled. I can't figure out how to stop that warning from appearing. I
-
Hardware Sizing for EBP, MDM Catalog
Hi, This is for an SRM implementation project in extended classic scenario. The plan is to use all 3 components EBP, MDM Catalogs and SUS. We are sizing hardware for a mid size company with around 10,000 employee base and USD 350 million of spend to