From 01c2f4930a7aae703da06e97e8d2d530bcff3123 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Wed, 21 Nov 2012 13:32:46 -0600 Subject: [PATCH] ExtRobot: added default delay time, bugfix. --- project.properties | 4 ++-- src/main/com/jdbernard/util/ExtRobot.groovy | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/project.properties b/project.properties index ed8527a..a1bdcef 100644 --- a/project.properties +++ b/project.properties @@ -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 diff --git a/src/main/com/jdbernard/util/ExtRobot.groovy b/src/main/com/jdbernard/util/ExtRobot.groovy index 3995757..73e0fa7 100755 --- a/src/main/com/jdbernard/util/ExtRobot.groovy +++ b/src/main/com/jdbernard/util/ExtRobot.groovy @@ -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) } } /**