void init();
- // Get the list of all current devices. Note that this will implicitly mark
- // all of the returned devices as held, since the input mapping UI needs
- // some kind of stability when the user is to choose. Thus, when you are done
- // with the list and have set a new mapping, you must go through all the devices
- // you don't want and release them using release_device().
- std::vector<Device> get_devices();
+ // Get the list of all current devices. Note that if hold_devices==true,
+ // all of the returned devices will be marked as held (used by the input mapping UI,
+ // which needs some kind of stability when the user is to choose).
+ // Thus, when you are done with the list and have set a new mapping,
+ // you must go through all the devices you don't want and release them
+ // using release_device().
+ std::vector<Device> get_devices(bool hold_devices);
void hold_device(unsigned index);
void release_device(unsigned index); // Note: index is allowed to go out of bounds.
+ bool device_is_held(unsigned index); // Same here.
// If device is held, start or restart capture. If device is not held,
// stop capture if it isn't already.