function onKeyPressed(code, key) { switch (lowercase(key)) { case "s": player.chat = "S"; break; case "n": player.chat = "N"; break; } }