Using a switch would make this code block cleaner. And you don't really need the first If, if you are then handling each keyCode in it's own if.