Update input-event handing to Quartz-taps on OS X

Created by mthiel
Issue #238
This commit is contained in:
syed.amer@gilani.eu 2009-11-01 19:15:10 +00:00
parent 985648a95f
commit 9515338c75
4 changed files with 203 additions and 223 deletions

View file

@ -94,14 +94,14 @@ private:
void sendClipboardEvent(CEvent::Type type, ClipboardID id) const;
// message handlers
bool onMouseMove(SInt32 x, SInt32 y);
bool onMouseMove(SInt32 mx, SInt32 my);
// mouse button handler. pressed is true if this is a mousedown
// event, false if it is a mouseup event. macButton is the index
// of the button pressed using the mac button mapping.
bool onMouseButton(bool pressed, UInt16 macButton);
bool onMouseWheel(SInt32 xDelta, SInt32 yDelta) const;
bool onKey(EventRef event);
bool onKey(CGEventRef event);
bool onHotKey(EventRef event) const;
// map mac mouse button to synergy buttons
@ -152,7 +152,12 @@ private:
static bool isGlobalHotKeyOperatingModeAvailable();
static void setGlobalHotKeysEnabled(bool enabled);
static bool getGlobalHotKeysEnabled();
// Quartz event tap support
static CGEventRef handleCGInputEvent(CGEventTapProxy proxy,
CGEventType type,
CGEventRef event,
void* refcon);
private:
struct CHotKeyItem {
public:
@ -241,6 +246,10 @@ private:
// events
static CEvent::Type s_confirmSleepEvent;
// Quartz input event support
CFMachPortRef m_eventTapPort;
CFRunLoopSourceRef m_eventTapRLSR;
};
#endif