本文整理汇总了C++中HIDDevice::GetButtonPresses方法的典型用法代码示例。如果您正苦于以下问题:C++ HIDDevice::GetButtonPresses方法的具体用法?C++ HIDDevice::GetButtonPresses怎么用?C++ HIDDevice::GetButtonPresses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HIDDevice
的用法示例。
在下文中一共展示了HIDDevice::GetButtonPresses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QueueCallback
void InputHandler_MacOSX_HID::QueueCallback( void *target, int result, void *refcon, void *sender )
{
// The result seems useless as you can't actually return anything...
// refcon is the Device number
RageTimer now;
InputHandler_MacOSX_HID *This = (InputHandler_MacOSX_HID *)target;
IOHIDQueueInterface **queue = (IOHIDQueueInterface **)sender;
IOHIDEventStruct event;
AbsoluteTime zeroTime = { 0, 0 };
HIDDevice *dev = This->m_vDevices[size_t( refcon )];
vector<DeviceInput> vPresses;
while( (result = CALL(queue, getNextEvent, &event, zeroTime, 0)) == kIOReturnSuccess )
{
if( event.longValueSize != 0 && event.longValue != NULL )
{
free( event.longValue );
continue;
}
//LOG->Trace( "Got event with cookie %p, value %d", event.elementCookie, int(event.value) );
dev->GetButtonPresses( vPresses, event.elementCookie, event.value, now );
}
FOREACH_CONST( DeviceInput, vPresses, i )
INPUTFILTER->ButtonPressed( *i );
}