Commit Graph

7 Commits

Author SHA1 Message Date
Damien Lespiau
c20beabf93 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.
2010-11-30 14:40:38 +00:00
Damien Lespiau
94c2812d72 evdev: Only create a xkbcommon mapping for keyboard devices 2010-11-30 14:40:38 +00:00
Damien Lespiau
7cd6ba2828 evdev: Close the device gracefully in case of a read() error
Even with udev, the read fails before udev has a chance to signal the
change. Hence (and to handle errors gracefully anyway), let's remove the
device from the device manager in case of a read() error.
2010-11-30 14:40:38 +00:00
Damien Lespiau
afd279dd76 evdev: Merge clutter-event-evdev.[ch] into the device manager
The device manager now fully owns the GSources corresponding to the
devices it manages. This will allow not only to remove the source when
udev signals a device removal but also handle read() errors gracefully
by removing the faulty device from the manager.
2010-11-30 14:40:38 +00:00
Damien Lespiau
afee3b009c evdev: Support hotplug (addition/removal) of evdev devices
Just connect to the GUdevClient "uevent" signal and deals with
"add"/"remove" commands. This drives the installation/removal of
GSource to listen to the device.
2010-11-30 14:40:37 +00:00
Damien Lespiau
b83a4813a4 evdev: Make sure we only add evdev devices
Let's use the sysfs path of the device to make sure we only load evdev
device, not legacy mousedev ones for instance. We rely on the sysfs
API/ABI guarantees and look for devices finishing by /input%d/event%d.
2010-11-30 14:40:37 +00:00
Damien Lespiau
c6493885c3 evdev: First stab at an evdev backend
This backend is a event backend that can be enabled for EGL (for now).
It uses udev (gudev) to query input devices on a linux system, listens to
keyboard events from input devices and xkbcommon to translate raw key
codes into key keysyms.

This commit only supports key events, more to follow.
2010-11-30 14:40:37 +00:00