Adapt components to new Event::CHARACTER type

Issue #2264
This commit is contained in:
Norman Feske 2017-02-13 16:20:28 +01:00
parent 455bd9396e
commit aee90ed453
4 changed files with 19 additions and 8 deletions

View File

@ -508,6 +508,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
}
case Input::Event::TOUCH:
case Input::Event::CHARACTER:
case Input::Event::WHEEL:
{
Point abs_pos = Point(ev.ax(), ev.ay()) + input_origin;

View File

@ -72,6 +72,7 @@ static Input::Event translate_event(Input::Event const ev,
case Input::Event::INVALID:
case Input::Event::WHEEL:
case Input::Event::CHARACTER:
return ev;
}
return Input::Event();

View File

@ -76,6 +76,8 @@ void User_state::handle_event(Input::Event ev)
ay = ev.ay();
ev = Input::Event::create_touch_event(ax, ay, ev.code(),
ev.touch_release());
} else if (type == Event::CHARACTER) {
ev = Input::Event(type, ev.code(), ax, ay, rx, ry);
} else
ev = Input::Event(type, keycode, ax, ay, rx, ry);
@ -221,6 +223,12 @@ void User_state::handle_event(Input::Event ev)
if ((type == Event::RELEASE) && _input_receiver)
_input_receiver->submit_input_event(ev);
/*
* Forward character events
*/
if (type == Event::CHARACTER && _input_receiver)
_input_receiver->submit_input_event(ev);
/*
* Detect end of global key sequence
*/

View File

@ -22,14 +22,15 @@ using namespace Genode;
static char const * ev_type(Input::Event::Type type)
{
switch (type) {
case Input::Event::INVALID: return "INVALID";
case Input::Event::MOTION: return "MOTION ";
case Input::Event::PRESS: return "PRESS ";
case Input::Event::RELEASE: return "RELEASE";
case Input::Event::WHEEL: return "WHEEL ";
case Input::Event::FOCUS: return "FOCUS ";
case Input::Event::LEAVE: return "LEAVE ";
case Input::Event::TOUCH: return "TOUCH ";
case Input::Event::INVALID: return "INVALID";
case Input::Event::MOTION: return "MOTION ";
case Input::Event::PRESS: return "PRESS ";
case Input::Event::RELEASE: return "RELEASE";
case Input::Event::WHEEL: return "WHEEL ";
case Input::Event::FOCUS: return "FOCUS ";
case Input::Event::LEAVE: return "LEAVE ";
case Input::Event::TOUCH: return "TOUCH ";
case Input::Event::CHARACTER: return "CHARACTER";
}
return "";