How to get what keyboard button was pressed?

Like this:

Capture.PNG