![]() |
HAL
|
A map to keep track of the assigned keybinds. More...
#include <assigned_keybind_map.h>
Public Member Functions | |
void | assign (const QKeySequence &newkey, SettingsItemKeybind *setting, const QKeySequence &oldkey=QKeySequence()) |
SettingsItemKeybind * | currentAssignment (const QKeySequence &needle) const |
void | initMap () |
Static Public Member Functions | |
static AssignedKeybindMap * | instance () |
A map to keep track of the assigned keybinds.
The AssignedKeybindMap class keeps track of all configured keybinds and maps the sequence to a specific SettingsItemKeybind. It is implemented as a singleton pattern.
Definition at line 43 of file assigned_keybind_map.h.
void hal::AssignedKeybindMap::assign | ( | const QKeySequence & | newkey, |
SettingsItemKeybind * | setting, | ||
const QKeySequence & | oldkey = QKeySequence() |
||
) |
Maps a (new) keysequence to the corresponding SettingsItemKeybind. If an old key is provided it is first removed from the map.
newkey | - The (new) key. |
setting | - The corresponding keybind setting. |
oldkey | - The old key to be removed from the map. |
Definition at line 19 of file assigned_keybind_map.cpp.
References QKeySequence::isEmpty().
Referenced by hal::KeybindEdit::doValidate(), and hal::KeybindEdit::load().
SettingsItemKeybind * hal::AssignedKeybindMap::currentAssignment | ( | const QKeySequence & | needle | ) | const |
Get the keybind item that is associated with the given keysequence.
needle | - The keysequence for which the keybind item is wanted. |
Definition at line 14 of file assigned_keybind_map.cpp.
Referenced by hal::KeybindEdit::doValidate().
|
inline |
Clears all entries from the map.
Definition at line 72 of file assigned_keybind_map.h.
References QMap::clear().
|
static |
Get the singleton instance of the AssignedKeybindMap.
Definition at line 8 of file assigned_keybind_map.cpp.
Referenced by hal::KeybindEdit::doValidate(), and hal::KeybindEdit::load().