mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
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
This commit is contained in:
parent
d9e4d32374
commit
87993a864c
@ -25,13 +25,6 @@ namespace Input {
|
|||||||
|
|
||||||
struct Touch_id { unsigned value; };
|
struct Touch_id { unsigned value; };
|
||||||
|
|
||||||
struct Axis_id
|
|
||||||
{
|
|
||||||
enum { X = 1, Y = 2 };
|
|
||||||
|
|
||||||
unsigned value;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Event attributes
|
* Event attributes
|
||||||
*/
|
*/
|
||||||
@ -47,7 +40,13 @@ namespace Input {
|
|||||||
struct Touch { Touch_id id; float x, y; };
|
struct Touch { Touch_id id; float x, y; };
|
||||||
struct Touch_release { Touch_id id; };
|
struct Touch_release { Touch_id id; };
|
||||||
struct Seq_number { unsigned value; };
|
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 Event;
|
||||||
class Binding;
|
class Binding;
|
||||||
@ -239,7 +238,7 @@ void Input::Event::print(Genode::Output &out) const
|
|||||||
case TOUCH: print(out, "TOUCH ", _attr.touch.id.value, " ",
|
case TOUCH: print(out, "TOUCH ", _attr.touch.id.value, " ",
|
||||||
_xy<float>(_attr.touch)); break;
|
_xy<float>(_attr.touch)); break;
|
||||||
case SEQ_NUMBER: print(out, "SEQ_NUMBER ", _attr.seq_number.value); 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;
|
_attr.axis.value); break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user