}
public Device getKeyboardDevice() {
if (keyboardDevice == null) {
keyboardDriver = new MyKeyboardDriver();
keyListener = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
KeyboardEvent k = new KeyboardEvent(KeyEvent.KEY_PRESSED,
e.getWhen(), e.getModifiersEx(), e.getKeyCode(), e.getKeyChar());
keyboardDriver.dispatchEvent(k);