Input#

Contains variables related to button, mouse, and keyboard input.

Access with Input->.

Variables#

bool[]

Press

bool[]

Button

bool[]

KeyPress

bool[]

Key

untyped[]

Mouse

const int[]

KeyBindings

int

ModifierKeys

bool[]

DisableKey

bool[]

DisableButton

const bool[]

Joypad

const bool[]

ReadKey deprecated

bool[]

Hold deprecated

bool[]

KeyRaw deprecated

Enumerations#

enum Button: πŸ”— Source

Controller buttons.

Button CB_UP = 0

Button CB_DOWN = 1

Button CB_LEFT = 2

Button CB_RIGHT = 3

Button CB_A = 4

Button CB_B = 5

Button CB_START = 6

Button CB_L = 7

Button CB_R = 8

Button CB_MAP = 9

Button CB_EX1 = 10

Button CB_X = 10

Button CB_EX2 = 11

Button CB_Y = 11

Button CB_EX3 = 12

Button CB_EX4 = 13

Button CB_STICKUP = 14

Button CB_STICKDOWN = 15

Button CB_STICKLEFT = 16

Button CB_STICKRIGHT = 17

Button CB_AXIS_UP = 14

Button CB_AXIS_DOWN = 15

Button CB_AXIS_LEFT = 16

Button CB_AXIS_RIGHT = 17

Button CB_MAX = 18


enum MouseIndex: πŸ”— Source

Used with Input->Mouse[].

MouseIndex MOUSE_X = 0

MouseIndex MOUSE_Y = 1

MouseIndex MOUSE_Z = 2

MouseIndex MOUSE_LEFT = 3

MouseIndex MOUSE_RIGHT = 4

MouseIndex MOUSE_MIDDLE = 5


enum KeyCode: πŸ”— Source

KeyCode KEY_A = 1

KeyCode KEY_B = 2

KeyCode KEY_C = 3

KeyCode KEY_D = 4

KeyCode KEY_E = 5

KeyCode KEY_F = 6

KeyCode KEY_G = 7

KeyCode KEY_H = 8

KeyCode KEY_I = 9

KeyCode KEY_J = 10

KeyCode KEY_K = 11

KeyCode KEY_L = 12

KeyCode KEY_M = 13

KeyCode KEY_N = 14

KeyCode KEY_O = 15

KeyCode KEY_P = 16

KeyCode KEY_Q = 17

KeyCode KEY_R = 18

KeyCode KEY_S = 19

KeyCode KEY_T = 20

KeyCode KEY_U = 21

KeyCode KEY_V = 22

KeyCode KEY_W = 23

KeyCode KEY_X = 24

KeyCode KEY_Y = 25

KeyCode KEY_Z = 26

KeyCode KEY_0 = 27

KeyCode KEY_1 = 28

KeyCode KEY_2 = 29

KeyCode KEY_3 = 30

KeyCode KEY_4 = 31

KeyCode KEY_5 = 32

KeyCode KEY_6 = 33

KeyCode KEY_7 = 34

KeyCode KEY_8 = 35

KeyCode KEY_9 = 36

KeyCode KEY_0_PAD = 37

KeyCode KEY_1_PAD = 38

KeyCode KEY_2_PAD = 39

KeyCode KEY_3_PAD = 40

KeyCode KEY_4_PAD = 41

KeyCode KEY_5_PAD = 42

KeyCode KEY_6_PAD = 43

KeyCode KEY_7_PAD = 44

KeyCode KEY_8_PAD = 45

KeyCode KEY_9_PAD = 46

KeyCode KEY_F1 = 47

KeyCode KEY_F2 = 48

KeyCode KEY_F3 = 49

KeyCode KEY_F4 = 50

KeyCode KEY_F5 = 51

KeyCode KEY_F6 = 52

KeyCode KEY_F7 = 53

KeyCode KEY_F8 = 54

KeyCode KEY_F9 = 55

KeyCode KEY_F10 = 56

KeyCode KEY_F11 = 57

KeyCode KEY_F12 = 58

KeyCode KEY_ESC = 59

KeyCode KEY_TILDE = 60

KeyCode KEY_MINUS = 61

KeyCode KEY_EQUALS = 62

KeyCode KEY_BACKSPACE = 63

KeyCode KEY_TAB = 64

KeyCode KEY_OPENBRACE = 65

KeyCode KEY_CLOSEBRACE = 66

KeyCode KEY_ENTER = 67

KeyCode KEY_COLON = 68

KeyCode KEY_QUOTE = 69

KeyCode KEY_BACKSLASH = 70

KeyCode KEY_BACKSLASH2 = 71

KeyCode KEY_COMMA = 72

KeyCode KEY_STOP = 73

KeyCode KEY_SLASH = 74

KeyCode KEY_SPACE = 75

KeyCode KEY_INSERT = 76

KeyCode KEY_DEL = 77

KeyCode KEY_HOME = 78

KeyCode KEY_END = 79

KeyCode KEY_PGUP = 80

KeyCode KEY_PGDN = 81

KeyCode KEY_LEFT = 82

KeyCode KEY_RIGHT = 83

KeyCode KEY_UP = 84

KeyCode KEY_DOWN = 85

KeyCode KEY_SLASH_PAD = 86

KeyCode KEY_ASTERISK = 87

KeyCode KEY_MINUS_PAD = 88

KeyCode KEY_PLUS_PAD = 89

KeyCode KEY_DEL_PAD = 90

KeyCode KEY_ENTER_PAD = 91

KeyCode KEY_PRTSCR = 92

KeyCode KEY_PAUSE = 93

KeyCode KEY_ABNT_C1 = 94

KeyCode KEY_YEN = 95

KeyCode KEY_KANA = 96

KeyCode KEY_CONVERT = 97

KeyCode KEY_NOCONVERT = 98

KeyCode KEY_AT = 99

KeyCode KEY_CIRCUMFLEX = 100

KeyCode KEY_COLON2 = 101

KeyCode KEY_KANJI = 102

KeyCode KEY_EQUALS_PAD = 103

KeyCode KEY_BACKQUOTE = 104

KeyCode KEY_SEMICOLON = 105

KeyCode KEY_COMMAND = 106

KeyCode KEY_UNKNOWN1 = 107

KeyCode KEY_UNKNOWN2 = 108

KeyCode KEY_UNKNOWN3 = 109

KeyCode KEY_UNKNOWN4 = 110

KeyCode KEY_UNKNOWN5 = 111

KeyCode KEY_UNKNOWN6 = 112

KeyCode KEY_UNKNOWN7 = 113

KeyCode KEY_UNKNOWN8 = 114

KeyCode KEY_MODIFIERS = 115

KeyCode KEY_LSHIFT = 115

KeyCode KEY_RSHIFT = 116

KeyCode KEY_LCONTROL = 117

KeyCode KEY_RCONTROL = 118

KeyCode KEY_ALT = 119

KeyCode KEY_ALTGR = 120

KeyCode KEY_LWIN = 121

KeyCode KEY_RWIN = 122

KeyCode KEY_MENU = 123

KeyCode KEY_SCRLOCK = 124

KeyCode KEY_NUMLOCK = 125

KeyCode KEY_CAPSLOCK = 126

KeyCode KEY_MAX = 127


enum KeyModifierBitflags: πŸ”— Source

KeyModifierBitflags KB_SHIFT_FLAG = 1

KeyModifierBitflags KB_CTRL_FLAG = 2

KeyModifierBitflags KB_ALT_FLAG = 4

KeyModifierBitflags KB_LWIN_FLAG = 8

KeyModifierBitflags KB_RWIN_FLAG = 16

KeyModifierBitflags KB_MENU_FLAG = 32

KeyModifierBitflags KB_COMMAND_FLAG = 64

KeyModifierBitflags KB_SCROLOCK_FLAG = 256

KeyModifierBitflags KB_NUMLOCK_FLAG = 512

KeyModifierBitflags KB_CAPSLOCK_FLAG = 1024

KeyModifierBitflags KB_INALTSEQ_FLAG = 2048

KeyModifierBitflags KB_ACCENT1_FLAG = 4096

KeyModifierBitflags KB_ACCENT2_FLAG = 8192

KeyModifierBitflags KB_ACCENT3_FLAG = 16384

KeyModifierBitflags KB_ACCENT4_FLAG = 32768


Variable descriptions#

bool[] Press πŸ”— Source

index Button (CB_)

Whether the given button was newly pressed this frame. This is true for exactly one frame per physical press, on the first frame the button is held down.

Writing to this only affects the current frame; the engine resets it from the real controller state next frame.


bool[] Button πŸ”— Source

index Button (CB_)

Whether the given button is currently held down.

Writing to this only affects the current frame (ex. writing false β€œeats” the input for the rest of the frame); the engine resets it from the real controller state next frame.


bool[] KeyPress πŸ”— Source

index KeyCode (KEY_)

Returns true if the respective key was just pressed this frame.


bool[] Key πŸ”— Source

index KeyCode (KEY_)

Returns true if the respective key is down this frame.


untyped[] Mouse πŸ”— Source


const int[] KeyBindings πŸ”— Source

index Button (CB_)

value KeyCode (KEY_)

For each button, the keyboard key that is bound to that button.


int ModifierKeys πŸ”— Source

value KeyModifierBitflags (KB_)

The state of the modifier keys.


bool[] DisableKey πŸ”— Source

index KeyCode (KEY_)

Whether a given keyboard key is disabled from having any in-engine effect.


bool[] DisableButton πŸ”— Source

index Button (CB_)

Whether a given button is disabled from having any in-engine effect.


const bool[] Joypad πŸ”— Source

index Button (CB_)

Similar to Press[], except that it only returns presses from a joystick device, not a keyboard.


const bool[] ReadKey πŸ”— Source

Deprecated: Use KeyPress[] instead!


bool[] Hold πŸ”— Source

Deprecated: Use Button[] instead!


bool[] KeyRaw πŸ”— Source

Deprecated: Unsafe!