Check Keyboard Events in code

yes, you have to create it in the editor like in the pic, then connect the code to it.