summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-07-12 11:22:52 +1000
committerChase Douglas <chase.douglas@canonical.com>2012-07-20 14:28:55 -0700
commitfbeaa2a51b123df06c2f426d35d15d3f4bc7b0f7 (patch)
tree5a85a1f7ee42725eba987eb9bd4333800922b6b6 /include
parent4e62312cb41095b3f237efa164166523d2963a0f (diff)
device: add PlayOne() for single event replaying
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/xorg/gtest/evemu/xorg-gtest-device.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/xorg/gtest/evemu/xorg-gtest-device.h b/include/xorg/gtest/evemu/xorg-gtest-device.h
index e4b3c4e..35e5459 100644
--- a/include/xorg/gtest/evemu/xorg-gtest-device.h
+++ b/include/xorg/gtest/evemu/xorg-gtest-device.h
@@ -76,6 +76,20 @@ class Device {
void Play(const std::string& path) const;
/**
+ * Play a single event through the device.
+ *
+ * Plays an event with the given type, code and value through the device.
+ *
+ * @param [in] type Evdev interface event type, e.g. EV_ABS, EV_REL, EV_KEY.
+ * @param [in] code Evdev interface event code, e.g. ABS_X, REL_Y, BTN_LEFT
+ * @param [in] value Event value
+ * @param [in] sync If true, submit an EV_SYN event after this event
+ *
+ * @throws std::runtime_error if playback failed for any reason.
+ */
+ void PlayOne(int type, int code, int value, bool sync = false);
+
+ /**
* Return the /dev/input/eventX device node for this device.
*
* Note that evemu doesn't know the device node, so we traverse the file