OS X key state. More...
#include <COSXKeyState.h>
Inherits CKeyState.
Classes | |
| class | CKeyResource |
| class | CUCHRKeyResource |
Public Types | |
| typedef std::vector< KeyID > | CKeyIDs |
Public Member Functions | |
| COSXKeyState (IEventQueue &eventQueue, CKeyMap &keyMap) | |
| virtual bool | fakeCtrlAltDel () |
| Fake ctrl+alt+del. | |
| virtual KeyModifierMask | pollActiveModifiers () const |
| Get the active modifiers from OS. | |
| virtual SInt32 | pollActiveGroup () const |
| Get the active keyboard layout from OS. | |
| virtual void | pollPressedKeys (KeyButtonSet &pressedKeys) const |
| Get the keys currently pressed from OS. | |
modifiers | |
| void | handleModifierKeys (void *target, KeyModifierMask oldMask, KeyModifierMask newMask) |
| Handle modifier key change. | |
accessors | |
| KeyModifierMask | mapModifiersFromOSX (UInt32 mask) const |
| Convert OS X modifier mask to synergy mask. | |
| KeyModifierMask | mapModifiersToCarbon (UInt32 mask) const |
| Convert CG flags-style modifier mask to old-style Carbon. | |
| KeyButton | mapKeyFromEvent (CKeyIDs &ids, KeyModifierMask *maskOut, CGEventRef event) const |
| Map key event to keys. | |
| bool | mapSynergyHotKeyToMac (KeyID key, KeyModifierMask mask, UInt32 &macVirtualKey, UInt32 &macModifierMask) const |
| Map key and mask to native values. | |
Protected Member Functions | |
| virtual void | getKeyMap (CKeyMap &keyMap) |
| Get the keyboard map. | |
| virtual void | fakeKey (const Keystroke &keystroke) |
| Fake a key event. | |
OS X key state.
A key state for OS X.
Definition at line 38 of file COSXKeyState.h.
| bool COSXKeyState::fakeCtrlAltDel | ( | ) | [virtual] |
Fake ctrl+alt+del.
Synthesize a press of ctrl+alt+del. Return true if processing is complete and false if normal key processing should continue.
Implements CKeyState.
Definition at line 388 of file COSXKeyState.cpp.
| void COSXKeyState::fakeKey | ( | const Keystroke & | keystroke | ) | [protected, virtual] |
Fake a key event.
Synthesize an event for keystroke.
Implements CKeyState.
Definition at line 483 of file COSXKeyState.cpp.
References CKeyState::getEffectiveGroup(), CKeyMap::Keystroke::kButton, CKeyMap::Keystroke::kGroup, and pollActiveGroup().
| void COSXKeyState::getKeyMap | ( | CKeyMap & | keyMap | ) | [protected, virtual] |
Get the keyboard map.
Fills keyMap with the current keyboard map.
Implements CKeyState.
Definition at line 437 of file COSXKeyState.cpp.
| void COSXKeyState::handleModifierKeys | ( | void * | target, | |
| KeyModifierMask | oldMask, | |||
| KeyModifierMask | newMask | |||
| ) |
Handle modifier key change.
Determines which modifier keys have changed and updates the modifier state and sends key events as appropriate.
Definition at line 729 of file COSXKeyState.cpp.
| KeyButton COSXKeyState::mapKeyFromEvent | ( | CKeyIDs & | ids, | |
| KeyModifierMask * | maskOut, | |||
| CGEventRef | event | |||
| ) | const |
Map key event to keys.
Converts a key event into a sequence of KeyIDs and the shadow modifier state to a modifier mask. The KeyIDs list, in order, the characters generated by the key press/release. It returns the id of the button that was pressed or released, or 0 if the button doesn't map to a known KeyID.
Definition at line 273 of file COSXKeyState.cpp.
References CKeyState::getActiveModifiers(), and mapModifiersToCarbon().
| KeyModifierMask COSXKeyState::mapModifiersFromOSX | ( | UInt32 | mask | ) | const |
Convert OS X modifier mask to synergy mask.
Returns the synergy modifier mask corresponding to the OS X modifier mask in mask.
Definition at line 219 of file COSXKeyState.cpp.
Referenced by pollActiveModifiers().
| KeyModifierMask COSXKeyState::mapModifiersToCarbon | ( | UInt32 | mask | ) | const |
Convert CG flags-style modifier mask to old-style Carbon.
Still required in a few places for translation calls.
Definition at line 247 of file COSXKeyState.cpp.
Referenced by mapKeyFromEvent().
| bool COSXKeyState::mapSynergyHotKeyToMac | ( | KeyID | key, | |
| KeyModifierMask | mask, | |||
| UInt32 & | macVirtualKey, | |||
| UInt32 & | macModifierMask | |||
| ) | const |
Map key and mask to native values.
Calculates mac virtual key and mask for a key key and modifiers mask. Returns true if the key can be mapped, false otherwise.
Definition at line 694 of file COSXKeyState.cpp.
References CKeyState::getButton(), and pollActiveGroup().
| SInt32 COSXKeyState::pollActiveGroup | ( | ) | const [virtual] |
Get the active keyboard layout from OS.
Returns the active keyboard layout according to the operating system.
Implements CKeyState.
Definition at line 401 of file COSXKeyState.cpp.
Referenced by fakeKey(), and mapSynergyHotKeyToMac().
| KeyModifierMask COSXKeyState::pollActiveModifiers | ( | ) | const [virtual] |
Get the active modifiers from OS.
Returns the modifiers that are currently active according to the operating system.
Implements CKeyState.
Definition at line 395 of file COSXKeyState.cpp.
References mapModifiersFromOSX().
| void COSXKeyState::pollPressedKeys | ( | KeyButtonSet & | pressedKeys | ) | const [virtual] |
Get the keys currently pressed from OS.
Adds any keys that are currently pressed according to the operating system to pressedKeys.
Implements CKeyState.
Definition at line 422 of file COSXKeyState.cpp.
1.7.1