creating and firing keyevent from action event on textfield
1001738Apr 9 2013 — edited May 8 2013My virtual keyboard have buttons to represent keys in keyboard. On button pressed action event is generated. To type some text in text field using virtual key board , changed all action events of each button pressed to key events and doing fireevent on textfield. But no text is seen in textfield. Not understanding what's happening with firevent. When printing keyevent code getting right code.
public void handle(ActionEvent event) {
textField.requestFocus();
KeyEvent keyEvent = KeyEvent.impl_keyEvent(textField, KeyCode.valueOf(name).impl_getChar(), name, KeyCode.valueOf(name).impl_getCode(), false, false, false, false, new EventType<KeyEvent>());
KeyCode code = keyEvent.getCode();
System.out.println("code : " + code);
textField.fireEvent(keyEvent);
keyEvent.consume();
}