14#include <IOKit/IOKitLib.h>
15#include <IOKit/IOCFPlugIn.h>
16#include <IOKit/hid/IOHIDLib.h>
17#include <IOKit/hid/IOHIDKeys.h>
18#include <CoreFoundation/CoreFoundation.h>
69 IOHIDQueueInterface**
queue {
nullptr};
86 void* refcon,
void* sender);
88 void* refcon,
void* sender);
virtual ~Listener()=default
virtual void appleRemoteButton(Event button, bool pressedDown)=0
void _handleEventWithCookieString(std::string cookieString, SInt32 sumOfValues)
std::vector< int > cookies
IOHIDDeviceInterface ** hidDeviceInterface
void _initCookieMap()
Apple keeps changing the "interface" between the remote and the OS.
std::map< std::string, Event > cookieToButtonMapping
static AppleRemote * _instance
void setListener(Listener *listener)
void setOpenInExclusiveMode(bool in)
bool _createDeviceInterface(io_object_t hidDevice)
bool isOpenInExclusiveMode()
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
static AppleRemote * Get()
IOHIDQueueInterface ** queue
void _queueCallbackFunction(IOReturn result, void *refcon, void *sender)
bool isListeningToRemote()
static void QueueCallbackFunction(void *target, IOReturn result, void *refcon, void *sender)
AppleRemote::Event mLastEvent
This is a wrapper around QThread that does several additional things.