Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Typedefs | Functions
VuoHid.h File Reference

Description

VuoHid interface.

Typedefs

typedef void * VuoHid
 Manages receiving HID control data.
 

Functions

char * VuoHid_getUsageText (uint32_t usagePage, uint32_t usage)
 Returns a string containing a verbal description of the specified USB HID usage.
 
VuoList_VuoHidDevice VuoHid_getDeviceList (void)
 Returns a list of the currently-avaialble HID devices.
 
VuoInteger VuoHid_getLocation (void *device)
 Given an IOHIDDeviceRef, returns its hopefully-unique Vuo-specific location (based on kIOHIDLocationIDKey and kUSBInterfaceNumber).
 
bool VuoHid_isElementValid (void *element)
 Returns true if the specified IOHIDElementRef is valid (contains usable data).
 
VuoHidControl VuoHid_getControlForElement (void *element)
 Creates a VuoHidControl from the values of the specified IOHIDElementRef.
 
void VuoHid_use (void)
 Indicates that the caller needs to get notifications about HID devices.
 
void VuoHid_disuse (void)
 Indicates that the caller no longer needs notifications about HID devices.
 
void VuoHid_addDevicesChangedTriggers (VuoOutputTrigger(devices, VuoList_VuoHidDevice))
 Adds a trigger callback, to be invoked whenever the list of known HID devices changes.
 
void VuoHid_removeDevicesChangedTriggers (VuoOutputTrigger(devices, VuoList_VuoHidDevice))
 Removes a trigger callback previously added by VuoHid_addDevicesChangedTriggers.
 
VuoHid VuoHid_make (const VuoHidDevice device, const VuoBoolean exclusive)
 Creates a reference-counted object for the specified HID device.
 
void VuoHid_checkPendingDevices (void)
 Attempts to open each device that has been requested but hasn't yet been successfully opened.
 
void VuoHid_addReceiveTrigger (VuoHid device, VuoOutputTrigger(receivedControl, VuoHidControl))
 Adds a trigger callback, to be invoked whenever the specified HID device receives data.
 
void VuoHid_removeReceiveTrigger (VuoHid device, VuoOutputTrigger(receivedControl, VuoHidControl))
 Removes a trigger callback previously added by VuoHid_addReceiveTrigger.
 

Typedef Documentation

typedef void* VuoHid

Manages receiving HID control data.

Function Documentation

void VuoHid_addDevicesChangedTriggers ( VuoOutputTrigger(devices, VuoList_VuoHidDevice )

Adds a trigger callback, to be invoked whenever the list of known HID devices changes.

Call VuoHid_use() before calling this.

This function may be called from any thread.

void VuoHid_addReceiveTrigger ( VuoHid  device,
VuoOutputTrigger(receivedControl, VuoHidControl  
)

Adds a trigger callback, to be invoked whenever the specified HID device receives data.

This function may be called from any thread.

void VuoHid_checkPendingDevices ( void  )

Attempts to open each device that has been requested but hasn't yet been successfully opened.

This function may be called from any thread.

void VuoHid_disuse ( void  )

Indicates that the caller no longer needs notifications about HID devices.

This function may be called from any thread.

VuoHidControl VuoHid_getControlForElement ( void *  element)

Creates a VuoHidControl from the values of the specified IOHIDElementRef.

VuoList_VuoHidDevice VuoHid_getDeviceList ( void  )

Returns a list of the currently-avaialble HID devices.

VuoInteger VuoHid_getLocation ( void *  device)

Given an IOHIDDeviceRef, returns its hopefully-unique Vuo-specific location (based on kIOHIDLocationIDKey and kUSBInterfaceNumber).

char* VuoHid_getUsageText ( uint32_t  usagePage,
uint32_t  usage 
)

Returns a string containing a verbal description of the specified USB HID usage.

The caller is responsible for freeing the returned string.

Based on "HID Usage Tables 10/28/2004 Version 1.12" (with a few spelling errors corrected), plus changes from Review Requests 28 through 52. Exceptions:

  • Implementation of RR39 is incomplete.
  • The conflicting assignments between RR33 (status "Review") and RR47 (status "Approved") are noted below; I went with the latter.
  • Includes usage 0x01:0xffffffff (Apple Mikey keycode).
  • Includes usage 0x07:0xffffffff (the 8-bit USB HID keycodes of up to 8 simultanouely-pressed keys).
  • Includes usage pages 0x84 and 0x85 from "Universal Serial Bus Usage Tables for HID Power Devices Release 1.0 November 1, 1997".
  • Includes usage page 0xff (Fn key on Apple Keyboards).
bool VuoHid_isElementValid ( void *  element)

Returns true if the specified IOHIDElementRef is valid (contains usable data).

VuoHid VuoHid_make ( const VuoHidDevice  device,
const VuoBoolean  exclusive 
)

Creates a reference-counted object for the specified HID device.

void VuoHid_removeDevicesChangedTriggers ( VuoOutputTrigger(devices, VuoList_VuoHidDevice )

Removes a trigger callback previously added by VuoHid_addDevicesChangedTriggers.

This function may be called from any thread.

void VuoHid_removeReceiveTrigger ( VuoHid  device,
VuoOutputTrigger(receivedControl, VuoHidControl  
)

Removes a trigger callback previously added by VuoHid_addReceiveTrigger.

This function may be called from any thread.

void VuoHid_use ( void  )

Indicates that the caller needs to get notifications about HID devices.

This function may be called from any thread.