function onKeyPressed(keycode, keychar){ switch(keychar) { case "a": // pressed a break; case "b": // pressed b break; }}