Vuo  2.0.0
Typedefs | Functions
VuoHid.h File Reference

Description

VuoHid interface.

Definition in file VuoHid.h.

Go to the source code of this file.

Typedefs

typedef void * VuoHid
 Manages receiving HID control data. More...
 

Functions

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

Typedef Documentation

◆ VuoHid

typedef void* VuoHid

Manages receiving HID control data.

Definition at line 38 of file VuoHid.h.

Function Documentation

◆ VuoHid_addDevicesChangedTriggers()

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.

Definition at line 457 of file VuoHidDevices.cc.

◆ VuoHid_addReceiveTrigger()

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.

Definition at line 272 of file VuoHidIo.cc.

◆ VuoHid_checkPendingDevices()

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.

Definition at line 195 of file VuoHidIo.cc.

◆ VuoHid_disuse()

void VuoHid_disuse ( void  )

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

This function may be called from any thread.

Definition at line 437 of file VuoHidDevices.cc.

◆ VuoHid_getControlForElement()

VuoHidControl VuoHid_getControlForElement ( void *  element)

Creates a VuoHidControl from the values of the specified IOHIDElementRef.

Definition at line 191 of file VuoHidDevices.cc.

◆ VuoHid_getDeviceList()

VuoList_VuoHidDevice VuoHid_getDeviceList ( void  )

Returns a list of the currently-avaialble HID devices.

Definition at line 215 of file VuoHidDevices.cc.

◆ VuoHid_getLocation()

VuoInteger VuoHid_getLocation ( void *  device)

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

Definition at line 136 of file VuoHidDevices.cc.

◆ VuoHid_getUsageText()

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 57. Exceptions:

  • Implementation of RR39 is incomplete.
  • RR43 is not published and is thus not implemented.
  • The conflicting assignments between RR33 and RR47 are resolved by RR57.
  • 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).

Definition at line 38 of file VuoHidUsage.c.

◆ VuoHid_isElementValid()

bool VuoHid_isElementValid ( void *  element)

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

Definition at line 162 of file VuoHidDevices.cc.

◆ VuoHid_make()

VuoHid VuoHid_make ( const VuoHidDevice  device,
const VuoBoolean  exclusive 
)

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

Definition at line 239 of file VuoHidIo.cc.

◆ VuoHid_removeDevicesChangedTriggers()

void VuoHid_removeDevicesChangedTriggers ( VuoOutputTrigger(devices, VuoList_VuoHidDevice )

Removes a trigger callback previously added by VuoHid_addDevicesChangedTriggers.

This function may be called from any thread.

Definition at line 468 of file VuoHidDevices.cc.

◆ VuoHid_removeReceiveTrigger()

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.

Definition at line 287 of file VuoHidIo.cc.

◆ VuoHid_use()

void VuoHid_use ( void  )

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

This function may be called from any thread.

Definition at line 380 of file VuoHidDevices.cc.