mirror of
https://github.com/debauchee/barrier.git
synced 2025-08-01 23:59:38 +02:00
Update input-event handing to Quartz-taps on OS X
Created by mthiel Issue #238
This commit is contained in:
parent
985648a95f
commit
9515338c75
4 changed files with 203 additions and 223 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue