mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-15 07:10:21 +01:00
tools: print missing event types in the demo client
Instead of aborting, print something useful Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/332>
This commit is contained in:
parent
2556ad38c6
commit
851f935fe1
1 changed files with 8 additions and 3 deletions
|
|
@ -320,7 +320,8 @@ int main(int argc, char **argv)
|
|||
if (!e)
|
||||
break;
|
||||
|
||||
switch(ei_event_get_type(e)) {
|
||||
enum ei_event_type type = ei_event_get_type(e);
|
||||
switch(type) {
|
||||
case EI_EVENT_CONNECT:
|
||||
colorprint("connected\n");
|
||||
break;
|
||||
|
|
@ -486,7 +487,7 @@ int main(int argc, char **argv)
|
|||
case EI_EVENT_TOUCH_MOTION:
|
||||
{
|
||||
colorprint("touch %s %u %.2f/%.2f\n",
|
||||
ei_event_get_type(e) == EI_EVENT_TOUCH_DOWN ? "down" : "motion",
|
||||
type == EI_EVENT_TOUCH_DOWN ? "down" : "motion",
|
||||
ei_event_touch_get_id(e),
|
||||
ei_event_touch_get_x(e),
|
||||
ei_event_touch_get_y(e));
|
||||
|
|
@ -503,7 +504,11 @@ int main(int argc, char **argv)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
{
|
||||
colorprint("ERROR: Unhandled event type %u (%s)\n",
|
||||
type, ei_event_type_to_string(type));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue