Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
keyboard.cpp File Reference

Functions

bool isSpecialKey (WPARAM virtual_key)
 Checks if the provided virtual key is found within the list of special keys. More...
 
bool isRegularKey (WPARAM virtual_key)
 Determines whether or not the provided key is found in the list of normal characters. More...
 
bool isRegularKey (char character)
 Determines whether or not the provided key is found in the list of normal characters. More...
 

Variables

std::vector< int > special_keys
 List of all special keys, or non-alphanumeric keys to be handled from the WM_KEYDOWN message. More...
 
std::vector< char > normal_chars
 List of all standard characters to be handled from the WM_CHAR message. More...
 
std::vector< SDL_Keycode > active_keys = {}
 
bool lock_keystate = false
 

Function Documentation

◆ isRegularKey() [1/2]

bool isRegularKey ( char  character)

Determines whether or not the provided key is found in the list of normal characters.

Parameters
virtual_key- The character recieved by the WM_CHAR message.
Returns
Whether or not the character is found in the normal characters list.

◆ isRegularKey() [2/2]

bool isRegularKey ( WPARAM  virtual_key)

Determines whether or not the provided key is found in the list of normal characters.

Parameters
virtual_key- The character recieved by the WM_CHAR message.
Returns
Whether or not the character is found in the normal characters list.

◆ isSpecialKey()

bool isSpecialKey ( WPARAM  virtual_key)

Checks if the provided virtual key is found within the list of special keys.

Parameters
virtual_key- The virtual key code.
Returns
Whether or not the special keys list contains the specified virtual key.

Variable Documentation

◆ active_keys

std::vector<SDL_Keycode> active_keys = {}

◆ lock_keystate

bool lock_keystate = false

◆ normal_chars

std::vector<char> normal_chars
Initial value:
=
{
'A', 'a', 'B', 'b', 'C', 'c', 'D', 'd', 'E', 'e', 'F', 'f', 'G', 'g', 'H', 'h', 'I', 'i', 'J',
'j', 'K', 'k', 'L', 'l', 'M', 'm', 'N', 'n', 'O', 'o', 'P', 'p', 'Q', 'q', 'R', 'r', 'S', 's',
'T', 't', 'U', 'u', 'V', 'v', 'W', 'w', 'X', 'x', 'Y', 'y', 'Z', 'z', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '0', '!', '@', '#', '$', '%', '^', '&', '(', ')', '[', ']', ';', ':', '"',
'\'', '<', '>', ',', '.', '/', '?', '\\', '|', '`', '~', ' ', '-', '=', '_', '+'
}

List of all standard characters to be handled from the WM_CHAR message.

◆ special_keys

std::vector<int> special_keys
Initial value:
=
{
SDLK_BACKSPACE, SDLK_LEFT, SDLK_RIGHT, SDLK_RETURN, SDLK_UP, SDLK_DOWN, SDLK_TAB, SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4,
SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12, SDLK_HOME
}

List of all special keys, or non-alphanumeric keys to be handled from the WM_KEYDOWN message.