Access to an input/HID device using the Input API in Linux.
More...
#include <SurgSim/Devices/MultiAxis/linux/InputDeviceHandle.h>
Access to an input/HID device using the Input API in Linux.
- See also
- SystemInputDeviceHandle
SurgSim::Device::InputDeviceHandle::~InputDeviceHandle |
( |
| ) |
|
Constructor.
Cannot be called directly.
- See also
- open
SurgSim::Device::InputDeviceHandle::InputDeviceHandle |
( |
const InputDeviceHandle & |
other | ) |
|
|
privatedelete |
Enumerates input devices.
- Parameters
-
logger | The logger to be used during enumeration. |
- Returns
- A list of device paths.
std::vector< int > SurgSim::Device::InputDeviceHandle::getDeviceButtonsAndKeys |
( |
| ) |
|
|
private |
Gets the indices of the available device buttons.
- Returns
- a vector of indices.
bool SurgSim::Device::InputDeviceHandle::getDeviceIds |
( |
int * |
vendorId, |
|
|
int * |
productId |
|
) |
| const |
|
overridevirtual |
Gets the device identifiers.
- Parameters
-
[out] | vendorId | The USB or PCI vendor identifier. |
[out] | productId | The USB or PCI product identifier. |
- Returns
- true if it succeeds.
Implements SurgSim::Device::SystemInputDeviceHandle.
std::string SurgSim::Device::InputDeviceHandle::getDeviceName |
( |
| ) |
const |
|
overridevirtual |
bool SurgSim::Device::InputDeviceHandle::hasAbsoluteTranslationAndRotationAxes |
( |
| ) |
const |
|
private |
Query if this device has 3 translation and 3 rotation {absolute} axes.
- Returns
- true if the desired axes are present.
bool SurgSim::Device::InputDeviceHandle::hasRelativeTranslationAndRotationAxes |
( |
| ) |
const |
|
private |
Query if this device has 3 translation and 3 rotation {relative} axes.
- Returns
- true if the desired axes are present.
bool SurgSim::Device::InputDeviceHandle::hasTranslationAndRotationAxes |
( |
| ) |
const |
|
overridevirtual |
Opens the given path and creates an access wrapper for the device.
- Parameters
-
path | Full pathname for the device. |
logger | The logger to be used by the device. |
- Returns
- The created device object, or an empty unique_ptr on failure.
bool SurgSim::Device::InputDeviceHandle::updateStates |
( |
AxisStates * |
axisStates, |
|
|
ButtonStates * |
buttonStates, |
|
|
bool * |
updated |
|
) |
| |
|
overridevirtual |
Updates the axis and states from the device input, if any.
- Parameters
-
[in,out] | axisStates | The states for each axis of the device. |
[in,out] | buttonStates | The states for each device button. |
[out] | updated | True if any states were actually updated. (Note that even if this value is true, the states may not have changed value; one or more states could have been updated to the same value.) |
- Returns
- true if the operation was successful; false if the device is no longer in a usable state.
Implements SurgSim::Device::SystemInputDeviceHandle.
std::unique_ptr<State> SurgSim::Device::InputDeviceHandle::m_state |
|
private |
The documentation for this class was generated from the following files: