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:
@ -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)",
|
||||
|
Reference in New Issue
Block a user