1 26 27 package net.sourceforge.groboutils.uicapture.v1.event; 28 29 import java.awt.Robot ; 30 import java.awt.event.InputEvent ; 31 import java.awt.event.KeyEvent ; 32 33 34 40 public abstract class KeyCaptureEvent extends CaptureEvent 41 { 42 45 private int keyCode = -1; 46 47 public KeyCaptureEvent( int type, KeyEvent event ) 48 { 49 super( type, (InputEvent )event ); 50 51 if (event != null) 52 { 53 this.keyCode = event.getKeyCode(); 54 } 55 } 56 57 58 public KeyCaptureEvent( int type, int keyCode ) 59 { 60 super( type ); 61 62 this.keyCode = keyCode; 63 } 64 65 66 public KeyEvent getKeyEvent() 67 { 68 return (KeyEvent )getInputEvent(); 69 } 70 71 72 public int getKeyCode() 73 { 74 return this.keyCode; 75 } 76 77 78 81 public void performEvent( Robot r ) 82 { 83 if (r == null) 84 { 85 throw new IllegalArgumentException ( "no null args" ); 86 } 87 } 88 } 89 90 | Popular Tags |