|
key = Any of the in built key codes:
vk_nokey
|
representing that no key is pressed
|
vk_anykey
|
representing that any key is pressed
|
vk_left
|
left arrow key
|
vk_right
|
right arrow key
|
vk_up
|
up arrow key
|
vk_down
|
down arrow key
|
vk_enter
|
enter key
|
vk_escape
|
escape key
|
vk_space
|
space key
|
vk_shift
|
shift key
|
vk_control
|
control key
|
vk_alt
|
alt key
|
vk_backspace
|
backspace key
|
vk_tab
|
tab key
|
vk_home
|
home key
|
vk_end
|
end key
|
vk_delete
|
delete key
|
vk_insert
|
insert key
|
vk_pageup
|
pageup key
|
vk_pagedown
|
pagedown key
|
vk_pause
|
pause/break key
|
vk_printscreen
|
printscreen/sysrq key
|
vk_f1 ... vk_f12
|
function keys F1 to F12
|
vk_numpad0
...
vk_numpad9
|
number keys on the numeric keypad
|
vk_multiply
|
multiply key on the numeric keypad
|
vk_divide
|
divide key on the numeric keypad
|
vk_add
|
add key on the numeric keypad
|
vk_subtract
|
subtract key on the numeric keypad
|
vk_decimal
|
decimal dot keys on the numeric keypad
|
This function will return which key on the keyboard is being pressed. For the letter keys use, for example, ord('A') (The capital letters.) For the digit keys use, for exampl,e ord('5') to get the <5> key. The following constants can only be used in keyboard_check_direct:
vk_lshift left shift key, vk_lcontrol left control key, vk_lalt left alt key, vk_rshift right shift key, vk_rcontrol right control key, vk_ralt right alt key.
Example:
if (keyboard_check(vk_left))
{
// whatever code you like if the left arrow key is pressed
}
|
The above example (if placed in the Step Event) will continually check if the left arrow key is being pressed.
Revision #1
|