AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
input.h
Go to the documentation of this file.
1
22#ifndef AER_INPUT_H
23#define AER_INPUT_H
24
25#include <stdbool.h>
26#include <stdint.h>
27
28/* ----- PUBLIC TYPES ----- */
29
30/* @deprecated Since 1.3.0. Use ::AER_KEY_ERASE_BEFORE instead. */
31#define AER_KEY_ERASE AER_KEY_ERASE __attribute__((deprecated))
37typedef enum AERInputKey {
38 AER_KEY_INTERRUPT = 0x3,
39 AER_KEY_BACKSPACE = 0x8,
40 AER_KEY_TAB = 0x9,
49 AER_KEY_ENTER = 0xd,
50 AER_KEY_CAPSLOCK = 0x14,
59 AER_KEY_ESCAPE = 0x1b,
60 AER_KEY_SPACE = 0x20,
61 AER_KEY_PAGEUP = 0x21,
62 AER_KEY_EXCLAIM = 0x21,
63 AER_KEY_PAGEDOWN = 0x22,
64 AER_KEY_QUOTE = 0x22,
65 AER_KEY_END = 0x23,
66 AER_KEY_HOME = 0x24,
67 AER_KEY_DOLLAR = 0x24,
68 AER_KEY_LARROW = 0x25,
69 AER_KEY_PERCENT = 0x25,
70 AER_KEY_UARROW = 0x26,
71 AER_KEY_AMP = 0x26,
72 AER_KEY_RARROW = 0x27,
73 AER_KEY_DARROW = 0x28,
74 AER_KEY_LPAREN = 0x28,
75 AER_KEY_RPAREN = 0x29,
76 AER_KEY_ASTERISK = 0x2a,
77 AER_KEY_PLUS = 0x2b,
78 AER_KEY_INSERT = 0x2d,
79 AER_KEY_DELETE = 0x2e,
80 AER_KEY_0 = 0x30,
81 AER_KEY_1 = 0x31,
82 AER_KEY_2 = 0x32,
83 AER_KEY_3 = 0x33,
84 AER_KEY_4 = 0x34,
85 AER_KEY_5 = 0x35,
86 AER_KEY_6 = 0x36,
87 AER_KEY_7 = 0x37,
88 AER_KEY_8 = 0x38,
89 AER_KEY_9 = 0x39,
90 AER_KEY_COLON = 0x3a,
91 AER_KEY_LESS = 0x3c,
92 AER_KEY_GREATER = 0x3e,
93 AER_KEY_QUERY = 0x3f,
94 AER_KEY_AT = 0x40,
95 AER_KEY_A = 0x41,
96 AER_KEY_B = 0x42,
97 AER_KEY_C = 0x43,
98 AER_KEY_D = 0x44,
99 AER_KEY_E = 0x45,
100 AER_KEY_F = 0x46,
101 AER_KEY_G = 0x47,
102 AER_KEY_H = 0x48,
103 AER_KEY_I = 0x49,
104 AER_KEY_J = 0x4a,
105 AER_KEY_K = 0x4b,
106 AER_KEY_L = 0x4c,
107 AER_KEY_M = 0x4d,
108 AER_KEY_N = 0x4e,
109 AER_KEY_O = 0x4f,
110 AER_KEY_P = 0x50,
111 AER_KEY_Q = 0x51,
112 AER_KEY_R = 0x52,
113 AER_KEY_S = 0x53,
114 AER_KEY_T = 0x54,
115 AER_KEY_U = 0x55,
116 AER_KEY_V = 0x56,
117 AER_KEY_W = 0x57,
118 AER_KEY_X = 0x58,
119 AER_KEY_Y = 0x59,
120 AER_KEY_Z = 0x5a,
121 AER_KEY_CARET = 0x5e,
122 AER_KEY_UNDERSCORE = 0x5f,
123 AER_KEY_NUM0 = 0x60,
124 AER_KEY_NUM1 = 0x61,
125 AER_KEY_NUM2 = 0x62,
126 AER_KEY_NUM3 = 0x63,
127 AER_KEY_NUM4 = 0x64,
128 AER_KEY_NUM5 = 0x65,
129 AER_KEY_NUM6 = 0x66,
130 AER_KEY_NUM7 = 0x67,
131 AER_KEY_NUM8 = 0x68,
132 AER_KEY_NUM9 = 0x69,
133 AER_KEY_NUMASTERISK = 0x6a,
134 AER_KEY_NUMPLUS = 0x6b,
135 AER_KEY_NUMMINUS = 0x6d,
136 AER_KEY_NUMPERIOD = 0x6e,
137 AER_KEY_NUMSLASH = 0x6f,
138 AER_KEY_F1 = 0x70,
139 AER_KEY_F2 = 0x71,
140 AER_KEY_F3 = 0x72,
141 AER_KEY_F4 = 0x73,
142 AER_KEY_F5 = 0x74,
143 AER_KEY_F6 = 0x75,
144 AER_KEY_F7 = 0x76,
145 AER_KEY_F8 = 0x77,
146 AER_KEY_F9 = 0x78,
147 AER_KEY_F10 = 0x79,
148 AER_KEY_LCURLY = 0x7b,
149 AER_KEY_VBAR = 0x7c,
150 AER_KEY_RCURLY = 0x7d,
151 AER_KEY_TILDE = 0x7e,
152 AER_KEY_F11 = 0x80,
153 AER_KEY_F12 = 0x81,
154 AER_KEY_LSHIFT = 0xa0,
155 AER_KEY_RSHIFT = 0xa1,
156 AER_KEY_LCTRL = 0xa2,
157 AER_KEY_RCTRL = 0xa3,
158 AER_KEY_LALT = 0xa4,
159 AER_KEY_RALT = 0xa5,
160 AER_KEY_SEMICOLON = 0xba,
161 AER_KEY_EQUALS = 0xbb,
162 AER_KEY_COMMA = 0xbc,
163 AER_KEY_MINUS = 0xbd,
164 AER_KEY_PERIOD = 0xbe,
165 AER_KEY_SLASH = 0xbf,
166 AER_KEY_APOS = 0xc0,
167 AER_KEY_LSQUARE = 0xdb,
168 AER_KEY_BACKSLASH = 0xdc,
169 AER_KEY_RSQUARE = 0xdd,
170 AER_KEY_HASH = 0xde,
171 AER_KEY_BACKTICK = 0xdf
173#undef AER_KEY_ERASE
174
175/* ----- PUBLIC CONSTANTS ----- */
176
182extern const char AER_DISPLAY_KEYS[];
183
184/* ----- PUBLIC FUNCTIONS ----- */
185
198const bool* AERInputGetKeysPressed(void);
199
212const bool* AERInputGetKeysHeld(void);
213
226const bool* AERInputGetKeysReleased(void);
227
248
261
274
292void AERInputGetMousePositionRaw(uint32_t* x, uint32_t* y);
293
294#define void __attribute__((deprecated)) void
306void AERInputGetMousePosition(uint32_t* x, uint32_t* y);
307#undef void
308
326void AERInputGetMousePositionVirtual(float* x, float* y);
327
328#endif /* AER_INPUT_H */
const bool * AERInputGetMouseButtonsPressed(void)
Query the mouse button(s) that the user just pressed this step.
const bool * AERInputGetKeysPressed(void)
Query the keyboard key(s) that the user just pressed this step.
void AERInputGetMousePositionRaw(uint32_t *x, uint32_t *y)
Query the current position of the mouse cursor in pixels relative to the game window.
void AERInputGetMousePositionVirtual(float *x, float *y)
Query the current position of the mouse cursor in pixels relative to the current room.
void AERInputGetMousePosition(uint32_t *x, uint32_t *y)
This function is a deprecated alias for AERInputGetMousePositionRaw.
const bool * AERInputGetKeysHeld(void)
Query the keyboard key(s) that the user has held this step.
const bool * AERInputGetKeysReleased(void)
Query the keyboard key(s) that the user just released this step.
const bool * AERInputGetMouseButtonsHeld(void)
Query the mouse button(s) that the user has held this step.
AERInputKey
Indexes for keypresses in input lookup table.
Definition: input.h:37
@ AER_KEY_ERASE_AFTER
Definition: input.h:44
@ AER_KEY_ERASE
Definition: input.h:54
@ AER_KEY_ERASE_BEFORE
Definition: input.h:58
@ AER_KEY_CLEAR
Definition: input.h:48
const char AER_DISPLAY_KEYS[]
Printable characters corresponding to input table indexes.
const bool * AERInputGetMouseButtonsReleased(void)
Query the mouse button(s) that the user just released this step.