Implement function to fake motion events
+8 · 2 files changed
-
grabber.cc+7 −0 -
grabber.h+1 −0
@@ -418,6 +418,13 @@ void Grabber::XiDevice::grab_button(ButtonInfo &bi, bool grab) { } } +void Grabber::XiDevice::fake_motion(int x, int y) { + XDevice fake_dev; + fake_dev.device_id = dev; + int axes[2] = { x, y }; + XTestFakeDeviceMotionEvent(dpy, &fake_dev, False, 0, axes, 2, 0); +} + void Grabber::grab_xi(bool grab) { if (!xi_grabbed == !grab) return; @@ -78,6 +78,7 @@ public: } void grab_device(bool grab); void grab_button(ButtonInfo &bi, bool grab); + void fake_motion(int x, int y); }; typedef std::map<XID, boost::shared_ptr<XiDevice> > DeviceMap;