Etterna 0.74.4
Loading...
Searching...
No Matches
InputHandler_MacOSX_HID.h
1#ifndef INPUT_HANDLER_MACOSX_HID_H
2#define INPUT_HANDLER_MACOSX_HID_H
3
4#include <vector>
5#include <CoreFoundation/CoreFoundation.h>
6#include <IOKit/IOKitLib.h>
7#include "InputHandler.h"
8#include "RageUtil/Misc/RageThreads.h"
9
10class HIDDevice;
11
13{
14 private:
15 std::vector<HIDDevice*> m_vDevices;
16 RageThread m_InputThread;
17 RageSemaphore m_Sem;
18 CFRunLoopRef m_LoopRef;
19 CFRunLoopSourceRef m_SourceRef;
20 std::vector<io_iterator_t> m_vIters; // We don't really care about these but they
21 // need to stick around
22 IONotificationPortRef m_NotifyPort;
23 RageMutex m_ChangeLock;
24 bool m_bChanged;
25
26 static int Run(void* data);
27 static void DeviceAdded(void* refCon, io_iterator_t iter);
28 static void DeviceChanged(void* refCon,
29 io_service_t service,
30 natural_t messageType,
31 void* arg);
32 void StartDevices();
33 void AddDevices(int usagePage, int usage, InputDevice& id);
34
35 public:
38
39 bool DevicesChanged()
40 {
41 LockMut(m_ChangeLock);
42 return m_bChanged;
43 }
44 void GetDevicesAndDescriptions(std::vector<InputDeviceInfo>& vDevicesOut);
45 std::string GetDeviceSpecificInputString(const DeviceInput& di);
46 wchar_t DeviceButtonToChar(DeviceButton button,
47 bool bUseCurrentKeyModifiers);
48 static void QueueCallback(void* target,
49 int result,
50 void* refcon,
51 void* sender);
52};
53
54#endif
Definition HIDDevice.h:70
Definition InputHandler_MacOSX_HID.h:13
A class designed to handle special input devices.
Definition InputHandler.h:23
Definition RageThreads.h:232
Definition RageThreads.h:334
Thread, mutex, semaphore, and event classes.
Definition RageThreads.h:155
Definition RageInputDevice.h:390