test-input: log event type as string

This commit is contained in:
Christian Helmuth 2014-06-23 14:18:35 +02:00 committed by Norman Feske
parent 786fe805da
commit 1c2ff67d96

View File

@ -20,6 +20,22 @@
using namespace Genode; 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 ";
}
return "";
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
/* /*
@ -50,8 +66,8 @@ int main(int argc, char **argv)
if (ev->type() == Input::Event::RELEASE) key_cnt--; if (ev->type() == Input::Event::RELEASE) key_cnt--;
/* log event */ /* log event */
PLOG("Input event type=%d\tcode=%d\trx=%d\try=%d\tkey_cnt=%d\t%s", PLOG("Input event type=%s\tcode=%d\trx=%d\try=%d\tkey_cnt=%d\t%s",
ev->type(), ev->code(), ev->rx(), ev->ry(), key_cnt, ev_type(ev->type()), ev->code(), ev->rx(), ev->ry(), key_cnt,
Input::key_name(static_cast<Input::Keycode>(ev->code()))); Input::key_name(static_cast<Input::Keycode>(ev->code())));
} }
} }