diff --git a/src/archutils/Darwin/MouseDevice.cpp b/src/archutils/Darwin/MouseDevice.cpp new file mode 100644 index 0000000000..c765fc0f30 --- /dev/null +++ b/src/archutils/Darwin/MouseDevice.cpp @@ -0,0 +1,24 @@ +#include "global.h" +#include "MouseDevice.h" + +bool MouseDevice::AddLogicalDevice( int usagePage, int usage ) +{ + // Mice can either be kHIDUsage_GD_Mouse or kHIDUsage_GD_Pointer... + // Let's just go with kHIDUsage_GD_Mouse for now. + return usagePage == kHIDPage_GenericDesktop && usage == kHIDUsage_GD_Mouse; +} + +void MouseDevice::AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ) +{ + if( usagePage != kHIDPage_GenericDesktop ) + return; + + DeviceButton button; + if( UsbKeyToDeviceButton(usage,button) ) + m_Mapping[cookie] = button; +} + +void MouseDevice::Open() +{ + // I hate coding blind... +} \ No newline at end of file diff --git a/src/archutils/Darwin/MouseDevice.h b/src/archutils/Darwin/MouseDevice.h new file mode 100644 index 0000000000..0dc1ee565f --- /dev/null +++ b/src/archutils/Darwin/MouseDevice.h @@ -0,0 +1,20 @@ +#ifndef MOUSE_DEVICE_H +#define MOUSE_DEVICE_H + +#include "HIDDevice.h" + +class MouseDevice : public HIDDevice +{ +private: + // stuff + +protected: + bool AddLogicalDevice( int usagePage, int usage ); + void AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties ) + void Open() + +public: + // even more stuff +}; + +#endif \ No newline at end of file