예제 #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());
     }
   }
 }
 public void keyUp(OperaKey key) {
   driver.getServices().getExec().key(key.toScope(), true);
 }
 public void keyDown(OperaKey key) {
   driver.getServices().getExec().key(key.toScope(), false);
 }
예제 #4
0
 public void pressKey(Keys keyToPress) {
   modifiers.add(keyToPress);
   exec.key(OperaKey.get(keyToPress).toScope(), false);
 }
예제 #5
0
 public void releaseKey(Keys keyToRelease) {
   modifiers.remove(keyToRelease);
   exec.key(OperaKey.get(keyToRelease).toScope(), true);
 }