well, I'm in over my head on this one, but this should be somewhat of a start

This commit is contained in:
AJ Kelly
2011-02-23 16:53:51 -06:00
parent 10936e8217
commit b8d79c1904
2 changed files with 44 additions and 0 deletions
+24
View File
@@ -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...
}
+20
View File
@@ -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