Arctic Engine
Designed to give you control and not take anything away.
|
Functions for handling keyboard, mouse, and controller input. More...
Classes | |
struct | arctic::InputMessage |
Structure representing an input message. More... | |
Enumerations | |
enum | arctic::ControllerAxis { kAxis0 = 0 , kAxis1 , kAxis2 , kAxis3 , kAxis4 , kAxis5 , kAxisCount } |
Enumeration of controller axis identifiers. | |
enum | arctic::KeyCode { arctic::kKeyNone = 0 , arctic::kKeyUnknown = 1 , kKeyLeft = 4 , kKeyRight = 5 , kKeyUp = 6 , kKeyDown = 7 , arctic::kKeyBackspace = 8 , arctic::kKeyTab = 9 , kKeyEnter = 13 , kKeyHome = 14 , kKeyEnd = 15 , kKeyPageUp = 16 , kKeyPageDown = 17 , kKeyShift = 18 , kKeyLeftShift = 19 , kKeyRightShift = 20 , kKeyControl = 21 , kKeyLeftControl = 22 , kKeyRightControl = 23 , kKeyAlt = 24 , kKeyLeftAlt = 25 , kKeyRightAlt = 26 , kKeyEscape = 27 , kKeySpace = 32 , kKeyApostrophe = 39 , kKeyComma = 44 , kKeyMinus = 45 , kKeyPeriod = 46 , kKeySlash = 47 , kKey0 = 48 , kKey1 = 49 , kKey2 = 50 , kKey3 = 51 , kKey4 = 52 , kKey5 = 53 , kKey6 = 54 , kKey7 = 55 , kKey8 = 56 , kKey9 = 57 , kKeySemicolon = 59 , kKeyPause = 60 , kKeyEquals = 61 , kKeyNumLock = 62 , kKeyScrollLock = 63 , kKeyCapsLock = 64 , kKeyA = 65 , kKeyB = 66 , kKeyC = 67 , kKeyD = 68 , kKeyE = 69 , kKeyF = 70 , kKeyG = 71 , kKeyH = 72 , kKeyI = 73 , kKeyJ = 74 , kKeyK = 75 , kKeyL = 76 , kKeyM = 77 , kKeyN = 78 , kKeyO = 79 , kKeyP = 80 , kKeyQ = 81 , kKeyR = 82 , kKeyS = 83 , kKeyT = 84 , kKeyU = 85 , kKeyV = 86 , kKeyW = 87 , kKeyX = 88 , kKeyY = 89 , kKeyZ = 90 , kKeyLeftSquareBracket = 91 , kKeyBackslash = 92 , kKeyRightSquareBracket = 93 , kKeyGraveAccent = 96 , kKeyF1 = 97 , kKeyF2 = 98 , kKeyF3 = 99 , kKeyF4 = 100 , kKeyF5 = 101 , kKeyF6 = 102 , kKeyF7 = 103 , kKeyF8 = 104 , kKeyF9 = 105 , kKeyF10 = 106 , kKeyF11 = 107 , kKeyF12 = 108 , kKeyNumpad0 = 109 , kKeyNumpad1 = 110 , kKeyNumpad2 = 111 , kKeyNumpad3 = 112 , kKeyNumpad4 = 113 , kKeyNumpad5 = 114 , kKeyNumpad6 = 115 , kKeyNumpad7 = 116 , kKeyNumpad8 = 117 , kKeyNumpad9 = 118 , kKeyNumpadSlash = 119 , kKeyNumpadAsterisk = 120 , kKeyNumpadMinus = 121 , kKeyNumpadPlus = 122 , kKeyNumpadPeriod = 123 , kKeyPrintScreen = 125 , kKeyInsert = 126 , kKeyDelete = 127 , kKeySectionSign = 245 , kKeyMouseUnknown = 256 , kKeyMouseLeft = 257 , kKeyMouseRight = 258 , kKeyMouseWheel = 259 , kKeyController0Button0 = 260 , kKeyController0Button1 = 261 , kKeyController0Button2 = 262 , kKeyController0Button3 = 263 , kKeyController0Button4 = 264 , kKeyController0Button5 = 265 , kKeyController0Button6 = 266 , kKeyController0Button7 = 267 , kKeyController0Button8 = 268 , kKeyController0Button9 = 269 , kKeyController0Button10 = 270 , kKeyController0Button11 = 271 , kKeyController0Button12 = 272 , kKeyController0Button13 = 273 , kKeyController0Button14 = 274 , kKeyController0Button15 = 275 , kKeyController0Button16 = 276 , kKeyController0Button17 = 277 , kKeyController0Button18 = 278 , kKeyController0Button19 = 279 , kKeyController0Button20 = 280 , kKeyController0Button21 = 281 , kKeyController0Button22 = 282 , kKeyController0Button23 = 283 , kKeyController0Button24 = 284 , kKeyController0Button25 = 285 , kKeyController0Button26 = 286 , kKeyController0Button27 = 287 , kKeyController0Button28 = 288 , kKeyController0Button29 = 289 , kKeyController0Button30 = 290 , kKeyController0Button31 = 291 , kKeyController1Button0 = 292 , kKeyController1Button1 = 293 , kKeyController1Button2 = 294 , kKeyController1Button3 = 295 , kKeyController1Button4 = 296 , kKeyController1Button5 = 297 , kKeyController1Button6 = 298 , kKeyController1Button7 = 299 , kKeyController1Button8 = 300 , kKeyController1Button9 = 301 , kKeyController1Button10 = 302 , kKeyController1Button11 = 303 , kKeyController1Button12 = 304 , kKeyController1Button13 = 305 , kKeyController1Button14 = 306 , kKeyController1Button15 = 307 , kKeyController1Button16 = 308 , kKeyController1Button17 = 309 , kKeyController1Button18 = 310 , kKeyController1Button19 = 311 , kKeyController1Button20 = 312 , kKeyController1Button21 = 313 , kKeyController1Button22 = 314 , kKeyController1Button23 = 315 , kKeyController1Button24 = 316 , kKeyController1Button25 = 317 , kKeyController1Button26 = 318 , kKeyController1Button27 = 319 , kKeyController1Button28 = 320 , kKeyController1Button29 = 321 , kKeyController1Button30 = 322 , kKeyController1Button31 = 323 , kKeyController2Button0 = 324 , kKeyController2Button31 = 355 , kKeyController3Button0 = 356 , kKeyController3Button31 = 387 , kKeyCount = 388 } |
Enumeration of key codes for various input devices. More... | |
Key State Transition Functions | |
bool | arctic::IsKeyDownward (const KeyCode key_code) |
bool | arctic::IsKeyDownward (const char *keys) |
bool | arctic::IsKeyDownward (const char key) |
bool | arctic::IsKeyDownward (const Si32 key_code) |
bool | arctic::IsKeyDownward (const std::string &keys) |
bool | arctic::IsKeyDown (const KeyCode key_code) |
bool | arctic::IsKeyDown (const char *keys) |
bool | arctic::IsKeyDown (const char key) |
bool | arctic::IsKeyDown (const Si32 key_code) |
bool | arctic::IsKeyDown (const std::string &keys) |
bool | arctic::IsKeyUpward (const KeyCode key_code) |
bool | arctic::IsKeyUpward (const char *keys) |
bool | arctic::IsKeyUpward (const char key) |
bool | arctic::IsKeyUpward (const Si32 key_code) |
bool | arctic::IsKeyUpward (const std::string &keys) |
Global Key State Functions | |
bool | arctic::IsAnyKeyDownward () |
bool | arctic::IsAnyKeyDown () |
bool | arctic::IsAnyKeyUpward () |
Key State Manipulation Functions | |
void | arctic::SetKey (const KeyCode key_code, bool is_pressed) |
void | arctic::SetKey (const char key, bool is_pressed) |
void | arctic::ClearKeyStateTransitions () |
Controller and Mouse Input Functions | |
float | arctic::ControllerAxis (Si32 controller_idx, Si32 axis_idx) |
Vec2Si32 | arctic::MousePos () |
Si32 | arctic::MouseX () |
Si32 | arctic::MouseY () |
Vec2Si32 | arctic::MouseMove () |
Si32 | arctic::MouseWheelDelta () |
Input Message Functions | |
Si32 | arctic::InputMessageCount () |
const InputMessage & | arctic::GetInputMessage (Si32 idx) |
Functions for handling keyboard, mouse, and controller input.
This module provides functions for detecting key presses, mouse movements, and controller inputs. It supports various input detection methods including:
Key functions include IsKeyDown(), IsKeyDownward(), MousePos(), and ControllerAxis().
enum arctic::KeyCode |
void arctic::ClearKeyStateTransitions | ( | ) |
Clears all key state transition information
float arctic::ControllerAxis | ( | Si32 | controller_idx, |
Si32 | axis_idx | ||
) |
Gets the position of a controller axis
controller_idx | Index of the controller (0 for the first controller) |
axis_idx | Index of the axis on the controller |
const InputMessage & arctic::GetInputMessage | ( | Si32 | idx | ) |
Gets a specific input message from the last frame
idx | Index of the message to retrieve (0 to InputMessageCount()-1) |
Si32 arctic::InputMessageCount | ( | ) |
Gets the number of input messages received during the last frame
bool arctic::IsAnyKeyDown | ( | ) |
Checks if any key is currently being held down
bool arctic::IsAnyKeyDownward | ( | ) |
Checks if any key was pressed down during the last frame
bool arctic::IsAnyKeyUpward | ( | ) |
Checks if any key was released during the last frame
bool arctic::IsKeyDown | ( | const char * | keys | ) |
Checks if any of the specified keys is currently being held down
keys | A C-string containing one or more key character codes to check |
bool arctic::IsKeyDown | ( | const char | key | ) |
Checks if a specific key is currently being held down
key | The key character code to check |
bool arctic::IsKeyDown | ( | const KeyCode | key_code | ) |
Checks if a key is currently being held down
key_code | The key code to check |
bool arctic::IsKeyDown | ( | const Si32 | key_code | ) |
Checks if a key is currently being held down
key_code | The integer key code to check |
bool arctic::IsKeyDown | ( | const std::string & | keys | ) |
Checks if any of the specified keys is currently being held down
keys | A string containing one or more key character codes to check |
bool arctic::IsKeyDownward | ( | const char * | keys | ) |
Checks if any of the specified keys was pressed down during the last frame
keys | A C-string containing one or more key character codes to check |
bool arctic::IsKeyDownward | ( | const char | key | ) |
Checks if a specific key was pressed down during the last frame
key | The key character code to check |
bool arctic::IsKeyDownward | ( | const KeyCode | key_code | ) |
Checks if a key was pressed down during the last frame
key_code | The key code to check |
bool arctic::IsKeyDownward | ( | const Si32 | key_code | ) |
Checks if a key was pressed down during the last frame
key_code | The integer key code to check |
bool arctic::IsKeyDownward | ( | const std::string & | keys | ) |
Checks if any of the specified keys was pressed down during the last frame
keys | A string containing one or more key character codes to check |
bool arctic::IsKeyUpward | ( | const char * | keys | ) |
Checks if any of the specified keys was released during the last frame
keys | A C-string containing one or more key character codes to check |
bool arctic::IsKeyUpward | ( | const char | key | ) |
Checks if a specific key was released during the last frame
key | The key character code to check |
bool arctic::IsKeyUpward | ( | const KeyCode | key_code | ) |
Checks if a key was released during the last frame
key_code | The key code to check |
bool arctic::IsKeyUpward | ( | const Si32 | key_code | ) |
Checks if a key was released during the last frame
key_code | The integer key code to check |
bool arctic::IsKeyUpward | ( | const std::string & | keys | ) |
Checks if any of the specified keys was released during the last frame
keys | A string containing one or more key character codes to check |
Vec2Si32 arctic::MouseMove | ( | ) |
Gets the mouse movement vector since the last frame
Vec2Si32 arctic::MousePos | ( | ) |
Gets the current mouse cursor position
Si32 arctic::MouseWheelDelta | ( | ) |
Gets the mouse wheel rotation since the last frame
Si32 arctic::MouseX | ( | ) |
Gets the current mouse cursor X coordinate
Si32 arctic::MouseY | ( | ) |
Gets the current mouse cursor Y coordinate
void arctic::SetKey | ( | const char | key, |
bool | is_set_down | ||
) |
Sets the state of a key as if it was pressed or released at the end of the last frame
key | The key character code to modify |
is_set_down | True to set the key as pressed, false to set it as released |
void arctic::SetKey | ( | const KeyCode | key_code, |
bool | is_set_down | ||
) |
Sets the state of a key as if it was pressed or released at the end of the last frame
key_code | The key code to modify |
is_set_down | True to set the key as pressed, false to set it as released |