# This include file defines key: and joy: constants for use with commands like
#"keypress", "key is pressed" and "wait for key", and also axis: constants for
# "joystick axis".
# You don't need to include this file, it's done automatically.

define constant,begin
# These *key constants can be used with any keypress commands.
-1,anykey
-2,upkey
-3,downkey
-4,leftkey
-5,rightkey
-6,usekey
-7,menukey
-8,fleekey
-8,runkey
-9,cancelkey

01,key:Esc
02,key:1
02,key:Exclamation
03,key:2
03,key:At Sign
04,key:3
04,key:Hash
05,key:4
05,key:Dollar Sign
06,key:5
06,key:Percent
07,key:6
07,key:Circumflex
08,key:7
08,key:Ampersand
09,key:8
09,key:Asterix
09,key:Asterisk
10,key:9
10,key:Left Parenthesis
11,key:0
11,key:Right Parenthesis
12,key:Minus
12,key:Underscore
13,key:Equals
13,key:Plus
14,key:Backspace
15,key:Tab
16,key:Q
17,key:W
18,key:E
19,key:R
20,key:T
21,key:Y
22,key:U
23,key:I
24,key:O
25,key:P
26,key:Left Bracket
26,key:Left Brace
27,key:Right Bracket
27,key:Right Brace
28,key:Enter
29,key:Ctrl
30,key:A
31,key:S
32,key:D
33,key:F
34,key:G
35,key:H
36,key:J
37,key:K
38,key:L
39,key:Semicolon
39,key:Colon
40,key:Quote
40,key:Doublequote
40,key:Apostrophe
41,key:Backquote
41,key:Tilde
42,key:Left Shift
43,key:Backslash
43,key:Pipe
44,key:Z
45,key:X
46,key:C
47,key:V
48,key:B
49,key:N
50,key:M
51,key:Comma
51,key:Left Caret
52,key:Period
52,key:Right Caret
53,key:Slash
53,key:Question Mark
54,key:Right Shift
55,key:Numpad Asterix
55,key:Numpad Asterisk
56,key:Alt
57,key:Space
58,key:Capslock
59,key:F1
60,key:F2
61,key:F3
62,key:F4
63,key:F5
64,key:F6
65,key:F7
66,key:F8
67,key:F9
68,key:F10
69,key:Numlock   # On Macs this is the Clear numpad key instead
70,key:Scroll Lock
71,key:Home
72,key:Up
73,key:Page Up
74,key:Numpad Minus
75,key:Left
77,key:Right
78,key:Numpad Plus
79,key:End
80,key:Down
81,key:Page Down
82,key:Insert
83,key:Delete
87,key:F11
88,key:F12
91,key:Left Win Logo
91,key:Left Command   #Macintosh
91,key:Left Meta
92,key:Right Win Logo
92,key:Right Command  #Macintosh
92,key:Right Meta
93,key:Context

94,key:F13
95,key:F14
96,key:F15

97,key:Shift
98,key:Left Alt
99,key:Right Alt
100,key:Left Ctrl
101,key:Right Ctrl

102,key:Numpad Slash  # previously key:Slash
103,key:Numpad Enter  # previously key:Enter

104,key:Numpad 7  # previously key:Home
105,key:Numpad 8  # previously key:Up
106,key:Numpad 9  # previously key:Page Up
108,key:Numpad 4  # previously key:Left
109,key:Numpad 5
110,key:Numpad 6  # previously key:Right
112,key:Numpad 1  # previously key:End
113,key:Numpad 2  # previously key:Down
114,key:Numpad 3  # previously key:Page Down
115,key:Numpad 0  # previously key:Insert
116,key:Numpad Period  # previously key:Delete

117,key:Print Screen
118,key:Pause     # previously key:Numlock

119,key:Filtered Alt  # Same as key:Alt, but try to filter out keypresses which are part of window manager combinations

120,key:Any Enter  # either key:Enter or key:Numpad Enter
121,key:Meta  # either key:Left Meta or key:Right Meta
121,key:Win Logo
121,key:Command

# Keys >= 128 are scancodes for other devices (mouse, joystick)

128,joy:A          # B button on a SNES controller!
128,joy:Cross      # PS
129,joy:B          # A button on a SNES controller!
129,joy:Circle     # PS
130,joy:X          # Y button on a SNES controller!
130,joy:Square     # PS
131,joy:Y          # X button on a SNES controller!
131,joy:Triangle   # PS
132,joy:Left Stick # When pressed as a button
133,joy:Right Stick
# Center-left button: Select (NES, SNES, PS1-3), Back (Xbox), Share (PS4), View (Xbox)
134,joy:Select
134,joy:Back
# Center button: PS button (PS3), Xbox guide button
135,joy:Logo
135,joy:Guide
# Center-right button: Start (NES, SNES, Genesis, N64, Saturn, PS1-3, Xbox), Options (PS4), Menu (XBox)
136,joy:Start
137,joy:L1         # Left shoulder
138,joy:R1         # Right shoulder
139,joy:L2         # Left trigger. Also axis:L2
140,joy:R2         # Right trigger. Also axis:R2
#141-143 unassigned
# Dpad, and also translates axis:X/Y (left thumbstick on a gamepad) to button presses
# (unless "Map joystick (left) stick to dpad" is disabled)
144,joy:Left
145,joy:Right
146,joy:Up
147,joy:Down
# Translation of right stick (axis:RightX/Y) to button presses
148,joy:RStick Left
149,joy:RStick Right
150,joy:RStick Up
151,joy:RStick Down

# Obsolete aliases
144,joy:x left
145,joy:x right
146,joy:y up
147,joy:y down

128,joy:button 1
129,joy:button 2
130,joy:button 3
131,joy:button 4
132,joy:button 5
133,joy:button 6
134,joy:button 7
135,joy:button 8
136,joy:button 9
137,joy:button 10
138,joy:button 11
139,joy:button 12
140,joy:button 13
141,joy:button 14
142,joy:button 15
143,joy:button 16
144,joy:button 17
145,joy:button 18
146,joy:button 19
147,joy:button 20
148,joy:button 21
149,joy:button 22
150,joy:button 23
151,joy:button 24
152,joy:button 25
153,joy:button 26
154,joy:button 27
155,joy:button 28
156,joy:button 29
157,joy:button 30
158,joy:button 31
159,joy:button 32
# 160-163 reserved

# These are only returned by waitforkey(anykey)! You can't use them elsewhere!
# Don't confuse these with "left button", etc, which are used for "mouse click", etc.
#180,mouse:left
#181,mouse:right
#182,mouse:middle

end

define constant, begin
# Joystick axes
0, x axis  # Old style alias
1, y axis
# The X,Y axes are the left thumbstick on a gamepad
0, axis:X   # Also mapped to joy:Left, joy:Right
1, axis:Y   # Also mapped to joy:Up, joy:Down
2, axis:RightX  # Also mapped to joy:RStickLeft, joy:RStickRight
3, axis:RightY  # Also mapped to joy:RStickUp, joy:RStickDown
4, axis:L2   # Also mapped to joy:L2 button
5, axis:R2   # Also mapped to joy:R2 button
end