Simplify the code using KeyAdapter instead of KeyListener method.
Closes pull request #89