1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
Commit Graph

10 Commits

Author SHA1 Message Date
Kay Sievers
7ca9a05dca input_id: include limits.h 2010-01-21 08:46:17 +01:00
Dmitry Torokhov
89b6237342 input-id: identify touchscreens
Add detection of touchscreens to the input-id utility.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2009-12-03 13:20:10 +01:00
Martin Pitt
01db50919e input_id: Check mouse button for ID_INPUT_MOUSE
Before we bless an input device as a mouse, verify that it has a left button
(BTN_MOUSE).

Thanks to Dmitry Torokhov <dtor@mail.ru> for pointing out!
2009-12-03 13:15:50 +01:00
Martin Pitt
7c3db77111 input_id: check event mask
Check the capabilities/ev for the particular event class before testing bits in
that event class. This avoids testing potentially bogus data if the device does
not support that class of events at all.

Thanks to Dmitry Torokhov for pointing out!
2009-12-03 12:56:44 +01:00
Martin Pitt
175cb7b81d input_id: small optimization
In the parent traversal loop, use
udev_device_get_parent_with_subsystem_devtype() to only grab "input" class
devices.
2009-12-03 12:46:22 +01:00
Martin Pitt
b919e0ffee input_id: Do not tag non-input devices with ID_INPUT
Current rules only call it for input devices, but let's be correct.
2009-12-03 10:22:04 +01:00
Martin Pitt
22f9cb51c3 input_id: Fix endless loop for non-input devices
When being called on a device which is not in the "input" subsystem, or doesn't
have an "input" parent, it got stuck in an endless loop. Unfortunately this
includes the virtual/input/mice multiplexer, which exposes this bug on just
about every system.
2009-12-03 10:16:49 +01:00
Martin Pitt
5b9204787f input_id: code cleanup
Now use libudev to clean up hardcoded /sys/ and /device/ paths, and to also
support direct input device arguments. Now both "input4" and "event4" will
work.
2009-12-02 11:14:19 +01:00
Dmitry Torokhov
e0ead3ba82 extras/input_id: Correctly identify touchpads
BTN_TOUCH (as well as ABS_PRESSURE) is used not only by touchpads but
by touchscreens as well. The proper check for a touchpad is presence
of BTN_TOOL_FINGER and absence of BTN_TOOL_PEN (the latter to filter
out some tablets that use BTN_TOOL_FINGER).

Tablet matching should be on either BTN_TOOL_PEN or BTN_STYLUS.
2009-11-30 23:03:05 +01:00
Martin Pitt
a6cf773401 extras: Add input_id
input_id probes input/event devices for their class (keyboard, keys, mouse,
touchpad, tablet, joystick). This is based on the corresponding hal code in
hald/linux/device.c, input_test_{abs,rel,...}.

This should provide enough functionality to get hal-less X.org working (which
in particular needs to know exactly which devices are touchpads).

Replace the brittle hacks in 60-persistent-input.rules with checking for the
new ID_INPUT_* flags. This keeps the old ID_CLASS properties for now (but they
are to be removed later on).

Note: The current code has several hacks still, which are to be replaced with
proper libudev calls later on.
2009-11-30 18:38:43 +01:00