ExtRobot: added default delay time, bugfix.

This commit is contained in:
Jonathan Bernard 2012-11-21 13:32:46 -06:00
parent d2706e30bb
commit 01c2f4930a
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#Sun, 11 Nov 2012 18:23:08 -0600
#Wed, 21 Nov 2012 13:12:41 -0600
name=jdb-util
version=1.6
version=1.7
lib.local=true
build.number=0

View File

@ -8,7 +8,7 @@ public class ExtRobot {
@Delegate Robot robot
int delayTime
int delayTime = 100
public ExtRobot() { robot = new Robot() }
@ -20,10 +20,10 @@ public class ExtRobot {
}
}
public void pressCombination(List keyCodes) {
public void pressCombination(int... keyCodes) {
keyCodes.each { keyCode -> robot.keyPress(keyCode) }
robot.delay(delayTime)
keyCodes.reverse().each { keyCode -> robot.keyRelease(keyCode) }
(keyCodes as List).reverse().each { keyCode -> robot.keyRelease(keyCode) }
}
/**