benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

Create a method to press and release multiple keys #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From Mattias:

I think your code will first press and release KeyEvent.VK_CONTROL,
then press and release KeyEvent.VK_R. I suppose you want to press and
release both keys at the same time, you might be able to use the
following code (I don't know if there are better solutions):

pressKey(KeyEvent.VK_CONTROL);
pressKey(KeyEvent.VK_R);
releaseKey(KeyEvent.VK_CONTROL);
releaseKey(KeyEvent.VK_R);

Maybe it would be a good enhancement idea to create a method
supporting pressing multiple keys at the same time. - Shouldn't be too
difficult.

Original issue reported on code.google.com by Alex.Rui...@gmail.com on 28 May 2008 at 1:51

GoogleCodeExporter commented 9 years ago
Idea for RobotFixture:

  public void pressKeysThenRelease(int... keyCodes) 
  {
    for (int keyCode : keyCodes)
      keyPress(keyCode);

    waitForIdle();

    for (int keyCode : keyCodes)
      releaseKey(keyCode);
  }

Instead of using releaseKey(int), we mind think about a method similiar to
keyPress(int) which doesn't have a waitForIdle() after each key is released.

Original comment by matthi...@gmail.com on 28 May 2008 at 2:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 1:59

GoogleCodeExporter commented 9 years ago
Robot already provides the method 'pressAndReleaseKey(KeyPressInfo)' where
KeyPressInfo has the key code and (optionally) the code of the modifier to 
press.
Other than modifiers, I don't see why we would like to press two keys 
simultaneously.

Original comment by Alex.Rui...@gmail.com on 21 Jan 2009 at 6:24