evemu input device for replaying events through the Linux uinput evdev subsystem.
More...
#include <xorg/gtest/evemu/xorg-gtest-device.h>
|
| Device (const std::string &path) |
| Create a new device context. More...
|
|
void | Play (const std::string &path) const |
| Play a evemu recording through the device. More...
|
|
void | PlayOne (int type, int code, int value, bool sync=false) |
| Play a single event through the device. More...
|
|
const std::string & | GetDeviceNode (void) |
| Return the /dev/input/eventX device node for this device. More...
|
|
bool | HasEvent (int type, int code) |
| Check if a device supports a specific event. More...
|
|
bool | GetAbsData (int code, int *min, int *max, int *fuzz=NULL, int *flat=NULL, int *resolution=NULL) |
| Retrieve data about an absolute axis on this device. More...
|
|
evemu input device for replaying events through the Linux uinput evdev subsystem.
Use the Recording class to play back a specific recording.
◆ Device()
xorg::testing::evemu::Device::Device |
( |
const std::string & |
path | ) |
|
|
explicit |
Create a new device context.
- Parameters
-
[in] | path | Path to evemu device property file. |
- Exceptions
-
std::runtime_error | if the device property file could not be found or the device could not be created. |
◆ GetAbsData()
bool xorg::testing::evemu::Device::GetAbsData |
( |
int |
code, |
|
|
int * |
min, |
|
|
int * |
max, |
|
|
int * |
fuzz = NULL , |
|
|
int * |
flat = NULL , |
|
|
int * |
resolution = NULL |
|
) |
| |
Retrieve data about an absolute axis on this device.
- Parameters
-
[in] | code | The axis to query (e.g. ABS_X) |
[out] | min | Min value for this axis |
[out] | max | Max value for this axis |
[out] | fuzz | Fuzz value for this axis |
[out] | flat | Flat value for this axis |
[out] | resolution | Resolution of this axis |
- Returns
- false if this device doesn't have this axis, or true on success
◆ GetDeviceNode()
const std::string& xorg::testing::evemu::Device::GetDeviceNode |
( |
void |
| ) |
|
Return the /dev/input/eventX device node for this device.
Note that evemu doesn't know the device node, so we traverse the file system looking for it. There is a tiny chance of the device node being wrong, or the device disappearing before we find it. If the device node cannot be found, an empty string is returned.
- Returns
- The string representing the device node
◆ HasEvent()
bool xorg::testing::evemu::Device::HasEvent |
( |
int |
type, |
|
|
int |
code |
|
) |
| |
Check if a device supports a specific event.
- Parameters
-
[in] | type | Type of the event (EV_REL, EV_ABS, ...) |
[in] | code | Event code (ABS_X, REL_Y, ...) |
- Returns
- true if this device supports this event or false otherwise.
◆ Play()
void xorg::testing::evemu::Device::Play |
( |
const std::string & |
path | ) |
const |
Play a evemu recording through the device.
Plays the recording from the beginning through the end. This call will block until the recording has finished.
- Parameters
-
[in] | path | Path to evemu recording file. |
- Exceptions
-
std::runtime_error | if playback failed for any reason. |
◆ PlayOne()
void xorg::testing::evemu::Device::PlayOne |
( |
int |
type, |
|
|
int |
code, |
|
|
int |
value, |
|
|
bool |
sync = false |
|
) |
| |
Play a single event through the device.
Plays an event with the given type, code and value through the device.
- Parameters
-
[in] | type | Evdev interface event type, e.g. EV_ABS, EV_REL, EV_KEY. |
[in] | code | Evdev interface event code, e.g. ABS_X, REL_Y, BTN_LEFT |
[in] | value | Event value |
[in] | sync | If true, submit an EV_SYN event after this event |
- Exceptions
-
std::runtime_error | if playback failed for any reason. |
The documentation for this class was generated from the following file:
- /build/xorg-gtest-Ek1CuS/xorg-gtest-0.7.1/include/xorg/gtest/evemu/xorg-gtest-device.h