#include <CKeyMap.h>
Collaboration diagram for CKeyMap:
accessors | |
const KeyItem * | mapKey (Keystrokes &keys, KeyID id, SInt32 group, ModifierToKeys &activeModifiers, KeyModifierMask ¤tState, KeyModifierMask desiredMask, bool isAutoRepeat) const |
Map key press/repeat to keystrokes. | |
SInt32 | getNumGroups () const |
Get number of groups. | |
SInt32 | getEffectiveGroup (SInt32 group, SInt32 offset) const |
Compute a group number. | |
const KeyItemList * | findCompatibleKey (KeyID id, SInt32 group, KeyModifierMask required, KeyModifierMask sensitive) const |
Find key entry compatible with modifiers. | |
bool | isHalfDuplex (KeyID key, KeyButton button) const |
Test if modifier is half-duplex. | |
bool | isCommand (KeyModifierMask mask) const |
Test if modifiers indicate a command. | |
KeyModifierMask | getCommandModifiers () const |
void | collectButtons (const ModifierToKeys &modifiers, ButtonToKeyMap &keys) |
Get buttons from modifier map. | |
void | initModifierKey (KeyItem &item) |
Set modifier key state. | |
bool | isDeadKey (KeyID key) |
Test for a dead key. | |
KeyID | getDeadKey (KeyID key) |
Get corresponding dead key. | |
CString | formatKey (KeyID key, KeyModifierMask) |
Get string for a key and modifier mask. | |
bool | parseKey (const CString &, KeyID &) |
Parse a string into a key. | |
bool | parseModifiers (CString &, KeyModifierMask &) |
Parse a string into a modifier mask. | |
Public Types | |
typedef std::vector< KeyItem > | KeyItemList |
The KeyButtons needed to synthesize a KeyID. | |
typedef std::vector< Keystroke > | Keystrokes |
A sequence of keystrokes. | |
typedef std::multimap< KeyModifierMask, KeyItem > | ModifierToKeys |
A mapping of a modifier to keys for that modifier. | |
typedef std::map< KeyButton, const KeyItem * > | ButtonToKeyMap |
A set of buttons. | |
typedef void(* | ForeachKeyCallback )(KeyID, SInt32 group, KeyItem &, void *userData) |
Callback type for foreachKey . | |
Public Member Functions | |
manipulators | |
void | swap (CKeyMap &) |
Swap with another CKeyMap . | |
void | addKeyEntry (const KeyItem &item) |
Add a key entry. | |
void | addKeyAliasEntry (KeyID targetID, SInt32 group, KeyModifierMask targetRequired, KeyModifierMask targetSensitive, KeyID sourceID, KeyModifierMask sourceRequired, KeyModifierMask sourceSensitive) |
Add an alias key entry. | |
bool | addKeyCombinationEntry (KeyID id, SInt32 group, const KeyID *keys, UInt32 numKeys) |
Add a key sequence entry. | |
void | allowGroupSwitchDuringCompose () |
Enable composition across groups. | |
void | addHalfDuplexButton (KeyButton button) |
Add a half-duplex button. | |
void | clearHalfDuplexModifiers () |
Remove all half-duplex modifiers. | |
void | addHalfDuplexModifier (KeyID key) |
Add a half-duplex modifier. | |
void | finish () |
Finish adding entries. | |
void | foreachKey (ForeachKeyCallback cb, void *userData) |
Iterate over all added keys items. |
This class provides a keyboard mapping.
Definition at line 29 of file CKeyMap.h.
|
The KeyButtons needed to synthesize a KeyID.
An ordered list of Definition at line 69 of file CKeyMap.h. Referenced by addKeyAliasEntry(), addKeyCombinationEntry(), addKeyEntry(), and foreachKey(). |
|
Add a half-duplex button.
Records that button Definition at line 202 of file CKeyMap.cpp. |
|
Add a half-duplex modifier.
Records that modifier key Definition at line 214 of file CKeyMap.cpp. Referenced by CKeyState::setHalfDuplexMask(). |
|
Add an alias key entry.
If Definition at line 105 of file CKeyMap.cpp. References addKeyEntry(), findCompatibleKey(), getEffectiveGroup(), getNumGroups(), KeyItemList, CKeyMap::KeyItem::m_group, and CKeyMap::KeyItem::m_id. |
|
Add a key sequence entry.
Adds the sequence of keys Definition at line 135 of file CKeyMap.cpp. References getNumGroups(), and KeyItemList. |
|
Add a key entry.
Adds Definition at line 63 of file CKeyMap.cpp. References getNumGroups(), isDeadKey(), KeyItemList, CKeyMap::KeyItem::m_button, CKeyMap::KeyItem::m_client, CKeyMap::KeyItem::m_dead, CKeyMap::KeyItem::m_generates, CKeyMap::KeyItem::m_group, CKeyMap::KeyItem::m_id, CKeyMap::KeyItem::m_required, and CKeyMap::KeyItem::m_sensitive. Referenced by addKeyAliasEntry(). |
|
Enable composition across groups. If called then the keyboard map will allow switching between groups during key composition. Not all systems allow that. Definition at line 196 of file CKeyMap.cpp. |
|
Remove all half-duplex modifiers. Removes all half-duplex modifiers. This is called to set user configurable half-duplex settings. Definition at line 208 of file CKeyMap.cpp. Referenced by CKeyState::setHalfDuplexMask(). |
|
Get buttons from modifier map.
Put all the keys in Definition at line 387 of file CKeyMap.cpp. |
|
Find key entry compatible with modifiers.
Returns the Definition at line 340 of file CKeyMap.cpp. References getNumGroups(). Referenced by addKeyAliasEntry(), and CKeyState::getButton(). |
|
Finish adding entries. Called after adding entries, this does some internal housekeeping. Definition at line 220 of file CKeyMap.cpp. Referenced by CKeyState::updateKeyMap(). |
|
Iterate over all added keys items.
Calls Definition at line 235 of file CKeyMap.cpp. References KeyItemList. Referenced by CKeyState::updateKeyState(). |
|
Get string for a key and modifier mask. Converts a key and modifier mask into a string representing the combination. Definition at line 1142 of file CKeyMap.cpp. References CStringUtil::print(). |
|
Returns the modifiers that when combined with other keys indicate a command (e.g. shortcut or hotkey). Definition at line 375 of file CKeyMap.cpp. Referenced by isCommand(). |
|
Get corresponding dead key.
Returns the dead key corresponding to Definition at line 1084 of file CKeyMap.cpp. References isDeadKey(). |
|
Compute a group number.
Returns the number of the group Definition at line 334 of file CKeyMap.cpp. References getNumGroups(). Referenced by addKeyAliasEntry(), and CKeyState::getEffectiveGroup(). |
|
Get number of groups. Returns the number of keyboard groups (independent layouts) in the map. Definition at line 328 of file CKeyMap.cpp. Referenced by addKeyAliasEntry(), addKeyCombinationEntry(), addKeyEntry(), findCompatibleKey(), and getEffectiveGroup(). |
|
Set modifier key state.
Sets the modifier key state ( Definition at line 397 of file CKeyMap.cpp. References CKeyMap::KeyItem::m_generates, CKeyMap::KeyItem::m_id, and CKeyMap::KeyItem::m_lock. Referenced by CMSWindowsKeyState::getKeyMap(). |
|
Test if modifiers indicate a command.
Returns Definition at line 369 of file CKeyMap.cpp. References getCommandModifiers(). Referenced by mapKey(). |
|
Test for a dead key.
Returns Definition at line 1078 of file CKeyMap.cpp. Referenced by addKeyEntry(), and getDeadKey(). |
|
Test if modifier is half-duplex.
Returns Definition at line 363 of file CKeyMap.cpp. Referenced by CKeyState::sendKeyEvent(). |
|
Map key press/repeat to keystrokes.
Converts press/repeat of key Definition at line 254 of file CKeyMap.cpp. References isCommand(), and CKeyMap::KeyItem::m_button. Referenced by CKeyState::fakeKeyDown(), and CKeyState::fakeKeyRepeat(). |
|
Parse a string into a key.
Converts a string into a key. Returns Definition at line 1175 of file CKeyMap.cpp. |
|
Parse a string into a modifier mask.
Converts a string into a modifier mask. Returns Definition at line 1210 of file CKeyMap.cpp. |