keyboard_lastkey (Game Maker)

( Game Maker 6.1, 7 )

keyboard_lastkey - keycode of the last key pressed


keyboard_lastkey contains the keycode of the last key pressed.


Example of Use

if(keyboard_lastkey = vk_space)
   show_message("You pressed the space key");
   keyboard_laskey = 0;

The code in this example will display a message when the space key is pressed.

Related Pages

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.