Arctic Engine
Designed to give you control and not take anything away.
Collaboration diagram for Input:

Classes

struct  arctic::InputMessage
 

Enumerations

enum  ControllerAxis {
  kAxis0 = 0 , kAxis1 , kAxis2 , kAxis3 ,
  kAxis4 , kAxis5 , kAxisCount
}
 
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
}
 

Functions

void arctic::ClearKeyStateTransitions ()
 Clears key state transition information. More...
 
float arctic::ControllerAxis (Si32 controller_idx, Si32 axis_idx)
 Returns controller axis position.
 
const InputMessagearctic::GetInputMessage (Si32 idx)
 Returns the user input message with the index specified.
 
Si32 arctic::InputMessageCount ()
 Returns the number of user input messages obtained by the last Swap() call.
 
bool arctic::IsAnyKeyDown ()
 Returns true if key is currently down.
 
bool arctic::IsAnyKeyDownward ()
 Returns true if key transitioned from up to down state last frame.
 
bool arctic::IsAnyKeyUpward ()
 Returns true if key transitioned from down to up since last frame.
 
bool arctic::IsKeyDown (const char *keys)
 Returns true if any of the specified keys was pressed during the last frame. More...
 
bool arctic::IsKeyDown (const char key)
 Returns true if the key specified was pressed during the last frame. More...
 
bool arctic::IsKeyDown (const KeyCode key_code)
 Returns true if the key with the specified key_code was pressed during the last frame. More...
 
bool arctic::IsKeyDown (const std::string &keys)
 Returns true if any of the specified keys was pressed during the last frame. More...
 
bool arctic::IsKeyDownward (const char *keys)
 Returns true if any of the specified keys travelled downwards during the last frame. More...
 
bool arctic::IsKeyDownward (const char key)
 Returns true if the key specified travelled downwards during the last frame. More...
 
bool arctic::IsKeyDownward (const KeyCode key_code)
 Returns true if the key with the specified key_code travelled downwards during the last frame. More...
 
bool arctic::IsKeyDownward (const std::string &keys)
 Returns true if any of the specified keys travelled downwards during the last frame. More...
 
bool arctic::IsKeyUpward (const char *keys)
 Returns true if any of the specified keys was released during the last frame. More...
 
bool arctic::IsKeyUpward (const char key)
 Returns true if the key specified was released during the last frame. More...
 
bool arctic::IsKeyUpward (const KeyCode key_code)
 Returns true if the key with the specified key_code was released during the last frame. More...
 
bool arctic::IsKeyUpward (const std::string &keys)
 Returns true if any of the specified keys was released during the last frame. More...
 
Vec2Si32 arctic::MouseMove ()
 Returns mouse movement vector.
 
Vec2Si32 arctic::MousePos ()
 Returns mouse cursor position.
 
Si32 arctic::MouseWheelDelta ()
 Returns mouse wheel rotation delta.
 
void arctic::SetKey (const char key, bool is_set_down)
 Changes the stored key state. More...
 
void arctic::SetKey (const KeyCode key_code, bool is_set_down)
 Changes the stored key state. More...
 

Detailed Description

Enumeration Type Documentation

◆ KeyCode

Enumerator
kKeyNone 

Indicates absence of any key, like SQL null.

kKeyUnknown 

Indicates an unidentified key.

kKeyBackspace 

ASCII Backspace.

kKeyTab 

ASCII Horizontal Tab.

Function Documentation

◆ ClearKeyStateTransitions()

void arctic::ClearKeyStateTransitions ( )

Clears key state transition information.

IsKeyDownward() IsKeyUpward() IsAnyKeyDownward() and IsAnyKeyUpward() calls will return false after a ClearKeyStateTransitions() call untill the ShowFrame() call fills the key state transition infromation with the information on new transitions. IsKeyDown() IsAnyKeyDown() calls are not affected and return the actual state.

◆ IsKeyDown() [1/4]

bool arctic::IsKeyDown ( const char *  keys)

Returns true if any of the specified keys was pressed during the last frame.

Parameters
keysA c-string specifying one or more key character codes to check
Here is the call graph for this function:

◆ IsKeyDown() [2/4]

bool arctic::IsKeyDown ( const char  key)

Returns true if the key specified was pressed during the last frame.

Parameters
keyThe key character code

◆ IsKeyDown() [3/4]

bool arctic::IsKeyDown ( const KeyCode  key_code)

Returns true if the key with the specified key_code was pressed during the last frame.

Parameters
key_codeThe key code

◆ IsKeyDown() [4/4]

bool arctic::IsKeyDown ( const std::string &  keys)

Returns true if any of the specified keys was pressed during the last frame.

Parameters
keysA std::string specifying one or more key character codes to check
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsKeyDownward() [1/4]

bool arctic::IsKeyDownward ( const char *  keys)

Returns true if any of the specified keys travelled downwards during the last frame.

Parameters
keysA c-string specifying one or more key character codes to check
Here is the call graph for this function:

◆ IsKeyDownward() [2/4]

bool arctic::IsKeyDownward ( const char  key)

Returns true if the key specified travelled downwards during the last frame.

Parameters
keyThe key character code

◆ IsKeyDownward() [3/4]

bool arctic::IsKeyDownward ( const KeyCode  key_code)

Returns true if the key with the specified key_code travelled downwards during the last frame.

Parameters
key_codeThe key code

◆ IsKeyDownward() [4/4]

bool arctic::IsKeyDownward ( const std::string &  keys)

Returns true if any of the specified keys travelled downwards during the last frame.

Parameters
keysA std::string specifying one or more key character codes to check
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsKeyUpward() [1/4]

bool arctic::IsKeyUpward ( const char *  keys)

Returns true if any of the specified keys was released during the last frame.

Parameters
keysA c-string specifying one or more key character codes to check
Here is the call graph for this function:

◆ IsKeyUpward() [2/4]

bool arctic::IsKeyUpward ( const char  key)

Returns true if the key specified was released during the last frame.

Parameters
keyThe key character code

◆ IsKeyUpward() [3/4]

bool arctic::IsKeyUpward ( const KeyCode  key_code)

Returns true if the key with the specified key_code was released during the last frame.

Parameters
key_codeThe key code

◆ IsKeyUpward() [4/4]

bool arctic::IsKeyUpward ( const std::string &  keys)

Returns true if any of the specified keys was released during the last frame.

Parameters
keysA std::string specifying one or more key character codes to check
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetKey() [1/2]

void arctic::SetKey ( const char  key,
bool  is_set_down 
)

Changes the stored key state.

Parameters
keyThe key character code
is_set_downKey state to set as if it was the last seen state of the key

The state is set just like it would be if the key actually transitioned up or down at the end of the last frame. It may affect resuts of IsKeyDownward() IsKeyDown() IsKeyUpward() IsAnyKeyDownward() IsAnyKeyDown() and IsAnyKeyUpward() calls.

◆ SetKey() [2/2]

void arctic::SetKey ( const KeyCode  key_code,
bool  is_set_down 
)

Changes the stored key state.

Parameters
key_codeThe key code
is_set_downKey state to set as if it was the last seen state of the key

The state is set just like it would be if the key actually transitioned up or down at the end of the last frame. It may affect resuts of IsKeyDownward() IsKeyDown() IsKeyUpward() IsAnyKeyDownward() IsAnyKeyDown() and IsAnyKeyUpward() calls.