Plot:Key is pressed

From OHRRPGCE-Wiki

Jump to: navigation, search
key is pressed (scancode)

Returns true if the keyboard key with the specified scancode is being pressed (either held down or pressed since last tick), or false if it is not. The argument is a scancode, NOT the up key, down key, etc used with wait for key. I have provided an extra include file, SCANCODE.HSI that you can use to define friendly names for all the scancodes.


Keyboard scan codes:

  • 00
  • 01 ESC
  • 02 1
  • 03 2
  • 04 3
  • 05 4
  • 06 5
  • 07 6
  • 08 7
  • 09 8
  • 10 9
  • 11 0
  • 12 - _
  • 13 = +
  • 14 BACKSPACE
  • 15 TAB
  • 16 Q
  • 17 W
  • 18 E
  • 19 R
  • 20 T
  • 21 Y
  • 22 U
  • 23 I
  • 24 O
  • 25 P
  • 26 [ {
  • 27 ] }
  • 28 ENTER
  • 29 CTRL
  • 30 A
  • 31 S
  • 32 D
  • 33 F
  • 34 G
  • 35 H
  • 36 J
  • 37 K
  • 38 L
  • 39 ; :
  • 40 " '
  • 41 ` ~
  • 42 LEFT SHIFT
  • 43 \ |
  • 44 Z
  • 45 X
  • 46 C
  • 47 V
  • 48 B
  • 49 N
  • 50 M
  • 51 , <
  • 52 . >
  • 53 / ?
  • 54 RIGHT SHIFT
  • 55 PRINT SCREEN *
  • 56 ALT
  • 57 SPACE
  • 58 CAPSLOCK
  • 59 F1
  • 60 F2
  • 61 F3
  • 62 F4
  • 63 F5
  • 64 F6
  • 65 F7
  • 66 F8
  • 67 F9
  • 68 F10
  • 69 NUMLOCK
  • 70 SCROLL LOCK
  • 71 HOME 7
  • 72 UP 8
  • 73 PAGEUP 9
  • 74 KEYPAD -
  • 75 LEFT 4
  • 76 KEYPAD 5
  • 77 RIGHT 6
  • 78 KEYPAD +
  • 79 END 1
  • 80 DOWN 2
  • 81 PAGEDOWN 3
  • 82 INSERT 0
  • 83 DEL .
  • 84
  • 85
  • 86
  • 87 F11
  • 88 F12
  • 89
  • 90
  • 91 L WIN LOGO
  • 92 R WIN LOGO
  • 93 CONTEXT


         Joystick scan codes:
         
  • 128 BUTTON 1
  • 129 BUTTON 2
  • 130-143 BUTTON 3-16
  • 144 X LEFT
  • 145 X RIGHT
  • 146 Y UP
  • 147 Y DOWN
You can NOT wait for the player to press a key by continually polling key is pressed unless you stick a wait in your do loop. That's because key is pressed does not return real time data, but the state of the keyboard at the beginning of the current game tick.

[edit] See Also

Personal tools