Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

keyboard_clear

drewmccluskey edited this page Feb 12, 2019 · 2 revisions

keyboard_clear

This will delete the state of a key

Syntax:

keyboard_clear(Keys key)
Argument Description
Keys key Which key to clear the state of

Returns: bool

Description:

This function will clear the state of a specified key. So when you are using keyboard_check(key); and holding your selected key and then use keyboard_clear(key); for that key, keyboard_check(key); should return false, for returning true again the user must release the key and then press it again.

Example:

if (keyboard_check(Keys.D))
{
 Position.X += 5;
}
if (keyboard_check(Keys.A))
{
 keyboard_clear();
}

This code will move your object to the right when you held down the D key. When you press A on the keyboard the moving object should stop and will not move again until the D key is released and pressed again.

Back to Keyboard

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /