Changed use of getKeyText that didn't work on Mac. Replaced with
getKeyCode and, e.g. KeyEvent.VK_UP.