well, I'm in over my head on this one, but this should be somewhat of a start
This commit is contained in:
@@ -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...
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user