#include <COSXKeyState.h>
Inherits CKeyState.
Inheritance diagram for COSXKeyState:
Public Types | |
typedef std::vector< KeyID > | CKeyIDs |
Public Member Functions | |
COSXKeyState () | |
virtual | ~COSXKeyState () |
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 |
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. | |
KeyButton | mapKeyFromEvent (CKeyIDs &ids, KeyModifierMask *maskOut, EventRef 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) |
Classes | |
class | CKeyResource |
class | CUCHRKeyResource |
A key state for OS X.
Definition at line 28 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 278 of file COSXKeyState.cpp.
void COSXKeyState::getKeyMap | ( | CKeyMap & | keyMap | ) | [protected, virtual] |
Get the keyboard map.
Fills keyMap
with the current keyboard map.
Implements CKeyState.
Definition at line 317 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 571 of file COSXKeyState.cpp.
KeyButton COSXKeyState::mapKeyFromEvent | ( | CKeyIDs & | ids, | |
KeyModifierMask * | maskOut, | |||
EventRef | 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 173 of file COSXKeyState.cpp.
References CKeyState::getActiveModifiers().
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 136 of file COSXKeyState.cpp.
Referenced by pollActiveModifiers().
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 536 of file COSXKeyState.cpp.
References CKeyState::getButton(), and pollActiveGroup().
Referenced by COSXScreen::registerHotKey().
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 291 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 285 of file COSXKeyState.cpp.
References mapModifiersFromOSX().