From 87993a864cb4bdd96df6e8d44ea3702cb6f7ef99 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 3 Jan 2024 10:47:35 +0100 Subject: [PATCH] input/event.h: axis ids LX, LY, LT, RX, RY, and RT The axis IDs correspond to 2x analog sticks with 2 axes and 2x triggers. While being at it, the commit changes the Axis_id type to Axis::Id. Fixes #3669 --- repos/os/include/input/event.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/repos/os/include/input/event.h b/repos/os/include/input/event.h index 77874b285d..e9f84c71e1 100644 --- a/repos/os/include/input/event.h +++ b/repos/os/include/input/event.h @@ -25,13 +25,6 @@ namespace Input { struct Touch_id { unsigned value; }; - struct Axis_id - { - enum { X = 1, Y = 2 }; - - unsigned value; - }; - /* * Event attributes */ @@ -47,7 +40,13 @@ namespace Input { struct Touch { Touch_id id; float x, y; }; struct Touch_release { Touch_id id; }; struct Seq_number { unsigned value; }; - struct Axis { Axis_id id; float value; }; + + struct Axis + { + enum class Id : unsigned { LX = 1, LY, LT, RX, RY, RT } id; + + float value; + }; class Event; class Binding; @@ -239,7 +238,7 @@ void Input::Event::print(Genode::Output &out) const case TOUCH: print(out, "TOUCH ", _attr.touch.id.value, " ", _xy(_attr.touch)); break; case SEQ_NUMBER: print(out, "SEQ_NUMBER ", _attr.seq_number.value); break; - case AXIS: print(out, "AXIS ", _attr.axis.id.value, " ", + case AXIS: print(out, "AXIS ", unsigned(_attr.axis.id), " ", _attr.axis.value); break; }; }