genode_c_api/event: absolute-motion events

Absolute motion events are generated by "tablet" devices, e.g., Qemu
usb-tablet and IP-KVM appliances like PiKVM.

Issue #5105
This commit is contained in:
Christian Helmuth 2024-01-29 11:34:01 +01:00
parent 5f2691a65b
commit a0e0000108
2 changed files with 9 additions and 0 deletions

View File

@ -73,6 +73,8 @@ struct genode_event_submit
void (*rel_motion) (struct genode_event_submit *, int x, int y);
void (*abs_motion) (struct genode_event_submit *, int x, int y);
void (*touch) (struct genode_event_submit *,
struct genode_event_touch_args const *);

View File

@ -102,6 +102,12 @@ namespace {
batch.submit(Input::Relative_motion { x, y }); });
}
static void _abs_motion(struct genode_event_submit *myself, int x, int y)
{
_with_batch(myself, [&] (Event::Session_client::Batch &batch) {
batch.submit(Input::Absolute_motion { x, y }); });
}
static void _touch(struct genode_event_submit *myself,
struct genode_event_touch_args const *args)
{
@ -133,6 +139,7 @@ namespace {
press = _press;
release = _release;
rel_motion = _rel_motion;
abs_motion = _abs_motion;
touch = _touch;
touch_release = _touch_release;
wheel = _wheel;