Doc: UpKey( )

UpKey - check if the up arrow key is pressed down.

Syntax

pressed = UpKey( )

  • pressed - True / False, depending on if the up key is pressed down

Explanation

UpKey() checks if the up arrow key is currently pressed down.

Examples

Check if Up Arrow Key Pressed

The example code below checks to see if the up arrow key has been pressed down.

SetFPS 60

Do    
    Cls 0
        If UpKey() Then Print "Up Key Pressed"
    Sync
Loop

Related Pages

Check Other Arrow Keys

  • DownKey() - check if the down arrow key is pressed down
  • LeftKey() - check if the left arrow key is pressed down
  • RightKey() - check if the right arrow key is pressed down

Check Letter Keys

  • KeyState() - check if a letter key or other special key is pressed down by scancode

Check Other Common Keys

  • EnterKey() - check if the Enter key is pressed
  • SpaceKey() - check if the Space key is pressed.

Source Code

Tutorials

Categories: Functions : Input : Keyboard