From fbeaa2a51b123df06c2f426d35d15d3f4bc7b0f7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 Jul 2012 11:22:52 +1000 Subject: device: add PlayOne() for single event replaying Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas Signed-off-by: Chase Douglas --- include/xorg/gtest/evemu/xorg-gtest-device.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') 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 @@ -75,6 +75,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. * -- cgit v1.2.3