bool has_rel_coordinates = false;
bool has_mt_coordinates = false;
bool has_joystick_axes_or_buttons = false;
+ bool has_pad_buttons = false;
bool is_direct = false;
bool has_touch = false;
bool has_3d_coordinates = false;
bool has_keys = false;
- bool stylus_or_pen = false;
+ bool has_stylus = false;
+ bool has_pen = false;
bool finger_but_no_pen = false;
bool has_mouse_button = false;
bool is_mouse = false;
bool is_touchpad = false;
bool is_touchscreen = false;
bool is_tablet = false;
+ bool is_tablet_pad = false;
bool is_joystick = false;
bool is_accelerometer = false;
bool is_pointing_stick = false;
}
is_pointing_stick = test_bit(INPUT_PROP_POINTING_STICK, bitmask_props);
- stylus_or_pen = test_bit(BTN_STYLUS, bitmask_key) || test_bit(BTN_TOOL_PEN, bitmask_key);
+ has_stylus = test_bit(BTN_STYLUS, bitmask_key);
+ has_pen = test_bit(BTN_TOOL_PEN, bitmask_key);
finger_but_no_pen = test_bit(BTN_TOOL_FINGER, bitmask_key) && !test_bit(BTN_TOOL_PEN, bitmask_key);
for (button = BTN_MOUSE; button < BTN_JOYSTICK && !has_mouse_button; button++)
has_mouse_button = test_bit(button, bitmask_key);
has_mt_coordinates = false;
is_direct = test_bit(INPUT_PROP_DIRECT, bitmask_props);
has_touch = test_bit(BTN_TOUCH, bitmask_key);
+ has_pad_buttons = test_bit(BTN_0, bitmask_key) && has_stylus && !has_pen;
/* joysticks don't necessarily have buttons; e. g.
* rudders/pedals are joystick-like, but buttonless; they have
has_joystick_axes_or_buttons = test_bit(axis, bitmask_abs);
if (has_abs_coordinates) {
- if (stylus_or_pen)
+ if (has_stylus || has_pen)
is_tablet = true;
else if (finger_but_no_pen && !is_direct)
is_touchpad = true;
is_joystick = true;
if (has_mt_coordinates) {
- if (stylus_or_pen)
+ if (has_stylus || has_pen)
is_tablet = true;
else if (finger_but_no_pen && !is_direct)
is_touchpad = true;
is_touchscreen = true;
}
+ if (is_tablet && has_pad_buttons)
+ is_tablet_pad = true;
+
if (!is_tablet && !is_touchpad && !is_joystick &&
has_mouse_button &&
(has_rel_coordinates ||
udev_builtin_add_property(dev, test, "ID_INPUT_JOYSTICK", "1");
if (is_tablet)
udev_builtin_add_property(dev, test, "ID_INPUT_TABLET", "1");
+ if (is_tablet_pad)
+ udev_builtin_add_property(dev, test, "ID_INPUT_TABLET_PAD", "1");
return is_tablet || is_mouse || is_touchpad || is_touchscreen || is_joystick || is_pointing_stick;
}