@Override
 public void keyReleased(KeyEvent e) {
   Key k = mappings.get(e.getKeyCode());
   if (k != null) {
     k.release();
   }
 }
 @Override
 public void keyPressed(KeyEvent e) {
   Key k = mappings.get(e.getKeyCode());
   if (k != null) {
     k.press();
   }
 }