Signal that changes (depending on different key presses) is not working
By using the key press signal in an if risingedge check you are treating it as a clock, and making registers for all of the signals inside the if statement that depend on that clock. The key press signal however does not have the perfect clock transitions that you expect, for instance the buttons that drive it have some bounce to them which will trigger multiple executions of the hardware inside the if statement. Also it is very bad practice to use a signal as a  clock that is not on the special FPGA clock network. 

I understand that you want to perform this key press action once every key press. For this you will need 2 things: something to debounce each individual key press so that each press has a clean on off transition and something to make a pulse for one clock cycle when the debounced key press transitions from on to off. 

Here are some resources:
Debouncing buttons:
https://youtu.be/8ISfNm9zv18
Single clock pulse:
https://youtu.be/GHheNH1-S1Y