-
-
Notifications
You must be signed in to change notification settings - Fork 18
keyboard_check
drewmccluskey edited this page Feb 12, 2019
·
4 revisions
Returns if a specified keyboard key is being held down
keyboard_check(key)
Argument | Description |
---|---|
Keys key |
The key button to being checked if is held down |
Returns: bool
This function will check if a specified key is currently held down and then runs the code if so each step the key is held down. It is useful for controlling characters with keys such as the W, A, S, D pattern or the arrow keys.
if (keyboard_check(Keys.D))
{
Position.X += 10;
}
This code will move the object to the right when the D key is held down.
if (keyboard_check(Keys.Up))
{
Position.Y -= 5;
}
This code will move the object up when the up arrow key is held down.
Back to Keyboard