Use IOHIDElementCookie which is really a void* rather than int.

This commit is contained in:
Steve Checkoway
2008-10-05 08:25:31 +00:00
parent 05d91fe025
commit 5e7ea06c5f
9 changed files with 63 additions and 43 deletions
@@ -150,7 +150,7 @@ static bool UsbKeyToDeviceButton( UInt8 iUsbKey, DeviceButton &buttonOut )
return false;
}
void KeyboardDevice::AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties )
void KeyboardDevice::AddElement( int usagePage, int usage, IOHIDElementCookie cookie, const CFDictionaryRef properties )
{
if( usagePage != kHIDPage_KeyboardOrKeypad )
return;
@@ -162,13 +162,13 @@ void KeyboardDevice::AddElement( int usagePage, int usage, int cookie, const CFD
void KeyboardDevice::Open()
{
for( hash_map<int,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
for( hash_map<IOHIDElementCookie,DeviceButton>::const_iterator i = m_Mapping.begin(); i != m_Mapping.end(); ++i )
AddElementToQueue( i->first );
}
void KeyboardDevice::GetButtonPresses( vector<DeviceInput>& vPresses, int cookie, int value, const RageTimer& now ) const
void KeyboardDevice::GetButtonPresses( vector<DeviceInput>& vPresses, IOHIDElementCookie cookie, int value, const RageTimer& now ) const
{
hash_map<int, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
hash_map<IOHIDElementCookie, DeviceButton>::const_iterator iter = m_Mapping.find( cookie );
if( iter != m_Mapping.end() )
{