Code example for EventObject

Methods: getSource

0
    public static KeyEvent createFakeInputEvent(AnActionEvent event) {
        return new KeyEvent(event.getInputEvent().getComponent(), 0, System.currentTimeMillis(), 0, KeyEvent.VK_0, '0');
    } 
 
    public static KeyEvent createFakeInputEvent(EventObject event) {
        return new KeyEvent((Component) event.getSource(), 0, System.currentTimeMillis(), 0, KeyEvent.VK_0, '0');
    } 
 
 
}