Mana
|
#include <keyboardconfig.h>
Public Member Functions | |
void | init () |
Initializes the keyboard config explicitly. | |
void | retrieve () |
Retrieve the key values from config file. | |
void | store () |
Store the key values to config file. | |
void | makeDefault () |
Make the keys their default values. | |
bool | hasConflicts () |
Determines if any key assignments are the same as each other. | |
void | callbackNewKey () |
Calls a function back so the key re-assignment(s) can be seen. | |
int | getKeyValue (int index) const |
Obtain the value stored in memory. | |
int | getNewKeyIndex () const |
Get the index of the new key to be assigned. | |
bool | isEnabled () const |
Get the enable flag, which will stop the user from doing actions. | |
const std::string & | getKeyCaption (int index) const |
Get the key caption, providing more meaning to the user. | |
int | getKeyIndex (SDL_Keycode keyValue) const |
Get the key function index by providing the keys value. | |
std::string_view | getKeyName (std::string_view configName) const |
Get the key name by providing the keys config name. | |
int | getKeyEmoteOffset (SDL_Keycode keyValue) const |
Get the key function index for an emote by providing the offset value. | |
void | setEnabled (bool flag) |
Set the enable flag, which will stop the user from doing actions. | |
void | setNewKeyIndex (int value) |
Set the index of the new key to be assigned. | |
void | setNewKey (SDL_Keycode value) |
Set the value of the new key. | |
void | setSetupKeyboard (Setup_Keyboard *setupKey) |
Set a reference to the key setup window. | |
bool | isKeyActive (int index) const |
Checks if the key is active, by providing the key function index. | |
void | refreshActiveKeys () |
Takes a snapshot of all the active keys. | |
std::string | getBindError () const |
Private Attributes | |
int | mNewKeyIndex |
Index of new key to be assigned. | |
bool | mEnabled |
Flag to respond to key input. | |
Setup_Keyboard * | mSetupKey |
Reference to setup window. | |
KeyFunction | mKey [KEY_TOTAL] |
Pointer to all the key data. | |
const uint8_t * | mActiveKeys |
Stores a list of all the keys. | |
std::string | mBindError |
Definition at line 42 of file keyboardconfig.h.
All the key functions.
KEY_NO_VALUE is used in initialization, and should be unchanged. KEY_TOTAL should always be last (used as a conditional in loops). The key assignment view gets arranged according to the order of these values.
Definition at line 157 of file keyboardconfig.h.
void KeyboardConfig::callbackNewKey | ( | ) |
Calls a function back so the key re-assignment(s) can be seen.
Definition at line 208 of file keyboardconfig.cpp.
|
inline |
Definition at line 147 of file keyboardconfig.h.
const std::string & KeyboardConfig::getKeyCaption | ( | int | index | ) | const |
Get the key caption, providing more meaning to the user.
Definition at line 213 of file keyboardconfig.cpp.
int KeyboardConfig::getKeyEmoteOffset | ( | SDL_Keycode | keyValue | ) | const |
Get the key function index for an emote by providing the offset value.
Definition at line 242 of file keyboardconfig.cpp.
int KeyboardConfig::getKeyIndex | ( | SDL_Keycode | keyValue | ) | const |
Get the key function index by providing the keys value.
Definition at line 218 of file keyboardconfig.cpp.
std::string_view KeyboardConfig::getKeyName | ( | std::string_view | configName | ) | const |
Get the key name by providing the keys config name.
Definition at line 227 of file keyboardconfig.cpp.
|
inline |
Obtain the value stored in memory.
Definition at line 78 of file keyboardconfig.h.
|
inline |
Get the index of the new key to be assigned.
Definition at line 84 of file keyboardconfig.h.
bool KeyboardConfig::hasConflicts | ( | ) |
Determines if any key assignments are the same as each other.
No need to parse the square matrix: only check one triangle that's enough to detect conflicts
Definition at line 160 of file keyboardconfig.cpp.
void KeyboardConfig::init | ( | ) |
Initializes the keyboard config explicitly.
Definition at line 108 of file keyboardconfig.cpp.
|
inline |
Get the enable flag, which will stop the user from doing actions.
Definition at line 90 of file keyboardconfig.h.
bool KeyboardConfig::isKeyActive | ( | int | index | ) | const |
Checks if the key is active, by providing the key function index.
Definition at line 251 of file keyboardconfig.cpp.
void KeyboardConfig::makeDefault | ( | ) |
Make the keys their default values.
Definition at line 154 of file keyboardconfig.cpp.
void KeyboardConfig::refreshActiveKeys | ( | ) |
Takes a snapshot of all the active keys.
Definition at line 259 of file keyboardconfig.cpp.
void KeyboardConfig::retrieve | ( | ) |
Retrieve the key values from config file.
Definition at line 122 of file keyboardconfig.cpp.
|
inline |
Set the enable flag, which will stop the user from doing actions.
Definition at line 116 of file keyboardconfig.h.
|
inline |
Set the value of the new key.
Definition at line 128 of file keyboardconfig.h.
|
inline |
Set the index of the new key to be assigned.
Definition at line 122 of file keyboardconfig.h.
|
inline |
Set a reference to the key setup window.
Definition at line 134 of file keyboardconfig.h.
void KeyboardConfig::store | ( | ) |
Store the key values to config file.
Definition at line 141 of file keyboardconfig.cpp.
|
private |
Stores a list of all the keys.
Definition at line 237 of file keyboardconfig.h.
|
private |
Definition at line 239 of file keyboardconfig.h.
|
private |
Flag to respond to key input.
Definition at line 231 of file keyboardconfig.h.
|
private |
Pointer to all the key data.
Definition at line 235 of file keyboardconfig.h.
|
private |
Index of new key to be assigned.
Definition at line 230 of file keyboardconfig.h.
|
private |
Reference to setup window.
Definition at line 233 of file keyboardconfig.h.