# Scanning the keyboard directly

It is sometimes useful to know which keys are being pressed at a given moment and also when a key is released. For example, in a game, a certain key might start some action and releasing the key might stop it.

`GETEVENT32 ev&()` and `GETEVENTA32 ev&()` return the scan code of any key pressed to the third element of the array `ev&()`. It is the programmers responsibility to track the key currently being pressed. The scan codes are given in hex in the following representation of the keyboard: