COSXKeyState Class Reference

OS X key state. More...

#include <COSXKeyState.h>

Inherits CKeyState.

Collaboration diagram for COSXKeyState:
Collaboration graph
[legend]

List of all members.

Classes

class  CKeyResource
class  CUCHRKeyResource

Public Types

typedef std::vector< KeyID > CKeyIDs

Public Member Functions

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.
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)
 Fake a key event.

Detailed Description

OS X key state.

A key state for OS X.

Definition at line 28 of file COSXKeyState.h.


Member Function Documentation

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::fakeKey ( const Keystroke keystroke  )  [protected, virtual]

Fake a key event.

Synthesize an event for keystroke.

Implements CKeyState.

Definition at line 350 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 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().

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 302 of file COSXKeyState.cpp.


The documentation for this class was generated from the following files:

Generated on 12 Nov 2010 for synergy-plus by  doxygen 1.6.1