Exemplo n.º 1
0
 private void sendKeys(List<KeyEvent> events) {
   for (KeyEvent event : events) {
     if (event.isNewLine()) {
       exec.key(OperaKey.ENTER.toScope());
     } else if (event.isModifierRelease()) {
       releaseModifiers();
     } else if (event.isModifier()) {
       pressOrReleaseModifier(event.getKey());
     } else if (event.isSpecial()) {
       exec.key(OperaKey.get(event.getKey()).toScope());
     } else {
       type(event.getCharacter());
     }
   }
 }
Exemplo n.º 2
0
 public void pressKey(Keys keyToPress) {
   modifiers.add(keyToPress);
   exec.key(OperaKey.get(keyToPress).toScope(), false);
 }
Exemplo n.º 3
0
 public void releaseKey(Keys keyToRelease) {
   modifiers.remove(keyToRelease);
   exec.key(OperaKey.get(keyToRelease).toScope(), true);
 }