ManaPlus
|
#include <keyboardconfig.h>
Public Member Functions | |
KeyboardConfig () | |
void | init () |
void | deinit () |
bool | isEnabled () const |
void | setEnabled (const bool flag) |
void | refreshActiveKeys () |
KeysVector * | getActionVector (const SDL_Event &event) |
KeysVector * | getActionVectorByKey (const int i) |
bool | isActionActive (const InputActionT index) const |
void | update () |
void | handleActivateKey (const SDL_Event &event) |
void | handleActivateKey (const int key) |
void | handleDeActicateKey (const SDL_Event &event) |
void | handleDeActicateKey (const int key) |
InputActionT | getActionId (const SDL_Event &event) |
void | handleRepeat (const int time) |
void | resetRepeat (const int key) |
Static Public Member Functions | |
static InputActionT | getKeyIndex (const SDL_Event &event, const int grp) |
static std::string | getKeyShortString (const std::string &key) |
static SDLKey | getKeyFromEvent (const SDL_Event &event) |
static int | getKeyValueFromEvent (const SDL_Event &event) |
static std::string | getKeyName (const int key) |
Private Attributes | |
bool | mEnabled |
const uint8_t * | mActiveKeys |
uint8_t * | mActiveKeys2 |
unsigned int | mRepeatTime |
KeyToActionMap | mKeyToAction |
KeyToIdMap | mKeyToId |
KeyTimeMap | mKeyTimeMap |
bool | mBlockAltTab |
Definition at line 42 of file keyboardconfig.h.
KeyboardConfig::KeyboardConfig | ( | ) |
Definition at line 42 of file keyboardconfig.cpp.
void KeyboardConfig::deinit | ( | ) |
Definition at line 63 of file keyboardconfig.cpp.
References mActiveKeys2.
Referenced by Client::gameClear().
InputActionT KeyboardConfig::getActionId | ( | const SDL_Event & | event | ) |
Definition at line 162 of file keyboardconfig.cpp.
References getKeyValueFromEvent(), mKeyToId, and InputAction::NO_VALUE.
Referenced by InputManager::getActionByKey().
KeysVector * KeyboardConfig::getActionVector | ( | const SDL_Event & | event | ) |
Definition at line 145 of file keyboardconfig.cpp.
References getKeyValueFromEvent(), and mKeyToAction.
Referenced by InputManager::handleEvent().
KeysVector * KeyboardConfig::getActionVectorByKey | ( | const int | i | ) |
Definition at line 154 of file keyboardconfig.cpp.
References mKeyToAction.
Referenced by handleRepeat().
|
inlinestatic |
Definition at line 82 of file keyboardconfig.h.
|
static |
Get the key function index by providing the keys value.
Definition at line 69 of file keyboardconfig.cpp.
References InputManager::getKeyIndex(), getKeyValueFromEvent(), inputManager, and InputType::KEYBOARD.
Referenced by Game::updateHistory().
|
static |
Definition at line 80 of file keyboardconfig.cpp.
References _, CAST_S32, and strprintf().
Referenced by InputManager::getKeyStringLong(), and InputManager::updateKeyString().
|
static |
Definition at line 99 of file keyboardconfig.cpp.
References _.
Referenced by EAthena::BeingRecv::processBeingSpawn(), EAthena::BeingRecv::processBeingVisible(), TmwAthena::BeingRecv::processBeingVisible(), LocalPlayer::setHome(), InputManager::updateKeyString(), and SocialNavigationTab::updateList().
|
inlinestatic |
Definition at line 93 of file keyboardconfig.h.
References CAST_S32.
Referenced by getActionId(), getActionVector(), getKeyIndex(), handleActivateKey(), handleDeActicateKey(), and InputManager::setNewKey().
void KeyboardConfig::handleActivateKey | ( | const int | key | ) |
void KeyboardConfig::handleActivateKey | ( | const SDL_Event & | event | ) |
Definition at line 204 of file keyboardconfig.cpp.
References getKeyValueFromEvent(), mActiveKeys2, and resetRepeat().
Referenced by InputManager::handleEvent().
void KeyboardConfig::handleDeActicateKey | ( | const int | key | ) |
void KeyboardConfig::handleDeActicateKey | ( | const SDL_Event & | event | ) |
Definition at line 223 of file keyboardconfig.cpp.
References getKeyValueFromEvent(), mActiveKeys2, and resetRepeat().
Referenced by InputManager::handleEvent().
void KeyboardConfig::handleRepeat | ( | const int | time | ) |
Definition at line 242 of file keyboardconfig.cpp.
References BLOCK_END, BLOCK_START, CAST_S32, FOR_EACH, getActionVectorByKey(), inputManager, mActiveKeys, mActiveKeys2, mKeyTimeMap, mRepeatTime, and InputManager::triggerAction().
Referenced by InputManager::handleRepeat().
void KeyboardConfig::init | ( | ) |
Initializes the keyboard config explicitly.
Definition at line 54 of file keyboardconfig.cpp.
References config, Configuration::getBoolValue(), Configuration::getIntValue(), mActiveKeys2, mBlockAltTab, mEnabled, and mRepeatTime.
Referenced by Client::gameInit().
bool KeyboardConfig::isActionActive | ( | const InputActionT | index | ) | const |
Definition at line 171 of file keyboardconfig.cpp.
References InputManager::getKey(), inputFunctionSize, inputManager, InputType::KEYBOARD, mActiveKeys, mActiveKeys2, InputItem::type, InputItem::value, and InputFunction::values.
Referenced by InputManager::isActionActive0().
|
inline |
Get the enable flag, which will stop the user from doing actions.
Definition at line 59 of file keyboardconfig.h.
References mEnabled.
Referenced by Game::handleInput(), and InputManager::updateConditionMask().
void KeyboardConfig::refreshActiveKeys | ( | ) |
Takes a snapshot of all the active keys.
Definition at line 75 of file keyboardconfig.cpp.
References mActiveKeys.
Referenced by InputManager::handleEvent().
void KeyboardConfig::resetRepeat | ( | const int | key | ) |
Definition at line 273 of file keyboardconfig.cpp.
References mKeyTimeMap, and tick_time.
Referenced by handleActivateKey(), and handleDeActicateKey().
|
inline |
Set the enable flag, which will stop the user from doing actions.
Definition at line 71 of file keyboardconfig.h.
References mEnabled.
Referenced by Setup_Input::action(), Setup_Input::apply(), Setup_Input::cancel(), ItemAmountWindow::close(), TextDialog::close(), ItemAmountWindow::ItemAmountWindow(), TextCommandEditor::scheduleDelete(), TextCommandEditor::TextCommandEditor(), and TextDialog::TextDialog().
void KeyboardConfig::update | ( | ) |
Definition at line 198 of file keyboardconfig.cpp.
References inputManager, InputType::KEYBOARD, mKeyTimeMap, mKeyToAction, mKeyToId, and InputManager::updateKeyActionMap().
Referenced by Client::gameInit(), initEngines(), and InputManager::update().
|
private |
Stores a list of all the keys
Definition at line 140 of file keyboardconfig.h.
Referenced by handleRepeat(), isActionActive(), and refreshActiveKeys().
|
private |
Stores a list of all the keys
Definition at line 142 of file keyboardconfig.h.
Referenced by deinit(), handleActivateKey(), handleDeActicateKey(), handleRepeat(), init(), and isActionActive().
|
private |
Definition at line 152 of file keyboardconfig.h.
Referenced by init().
|
private |
Flag to respond to key input
Definition at line 138 of file keyboardconfig.h.
Referenced by init(), isEnabled(), and setEnabled().
|
private |
Definition at line 150 of file keyboardconfig.h.
Referenced by handleRepeat(), resetRepeat(), and update().
|
private |
Definition at line 146 of file keyboardconfig.h.
Referenced by getActionVector(), getActionVectorByKey(), and update().
|
private |
Definition at line 148 of file keyboardconfig.h.
Referenced by getActionId(), and update().
|
private |
Definition at line 144 of file keyboardconfig.h.
Referenced by handleRepeat(), and init().