onkeypress is only triggered for the 'active' field when a key is pressed.
You need to enable your element to receive focus. The trick is to add attr tabindex to #gameEvent.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.