evdev: Add mouse support

We know support EV_REL events comming from evdev devices. This addition
is pretty straigthforward, it adds a x,y per GSource listening to a
evdev device, updates from EL_REL (relative) events and craft new
ClutterMotionEvents. As for buttons, BTN_LEFT..BTN_TASK are translated
to ClutterButtonEvents with 1..8 as button number.
This commit is contained in:
Damien Lespiau
2010-11-11 19:07:35 -05:00
parent 94c2812d72
commit c20beabf93
2 changed files with 203 additions and 26 deletions

View File

@ -187,8 +187,12 @@ input_cb (ClutterActor *actor,
keybuf);
break;
case CLUTTER_MOTION:
g_print ("[%s] MOTION",
clutter_actor_get_name (source_actor));
{
ClutterMotionEvent *motion = (ClutterMotionEvent *) event;
g_print ("[%s] MOTION (%.02f,%.02f)",
clutter_actor_get_name (source_actor), motion->x, motion->y);
}
break;
case CLUTTER_ENTER:
g_print ("[%s] ENTER (from:%s)",