mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
parent
684ce272e6
commit
71c3fa53da
@ -23,7 +23,7 @@ class Input::Event
|
||||
{
|
||||
public:
|
||||
|
||||
enum Type { INVALID, MOTION, PRESS, RELEASE, WHEEL, FOCUS, LEAVE };
|
||||
enum Type { INVALID, MOTION, PRESS, RELEASE, WHEEL, FOCUS, LEAVE, TOUCH };
|
||||
|
||||
private:
|
||||
|
||||
@ -77,6 +77,12 @@ class Input::Event
|
||||
|
||||
bool is_absolute_motion() const { return _type == MOTION && !_rx && !_ry; }
|
||||
bool is_relative_motion() const { return _type == MOTION && (_rx || _ry); }
|
||||
bool is_touch_release() const { return _type == TOUCH && (_rx == -1) && (_ry == -1); }
|
||||
|
||||
static Event create_touch_event(int ax, int ay, int id, bool last = false)
|
||||
{
|
||||
return Event(Type::TOUCH, id, ax, ay, last ? -1 : 0, last ? -1 : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__INPUT__EVENT_H_ */
|
||||
|
@ -30,6 +30,7 @@ static char const * ev_type(Input::Event::Type type)
|
||||
case Input::Event::WHEEL: return "WHEEL ";
|
||||
case Input::Event::FOCUS: return "FOCUS ";
|
||||
case Input::Event::LEAVE: return "LEAVE ";
|
||||
case Input::Event::TOUCH: return "TOUCH ";
|
||||
}
|
||||
|
||||
return "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user