Commit 192c2f11 authored by Peter Hutterer's avatar Peter Hutterer

pad: drop the custom mapping code again

Jason will fix this upstream so we don't have to care about KEY_PROG1..3
parent 67f5159c
Pipeline #45729 passed with stages
in 2 minutes and 58 seconds
......@@ -618,36 +618,21 @@ pad_init_buttons_from_kernel(struct pad_dispatch *pad,
static void
pad_init_keys(struct pad_dispatch *pad, struct evdev_device *device)
{
unsigned int code;
unsigned int codes[] = {
KEY_BUTTONCONFIG,
KEY_ONSCREEN_KEYBOARD,
KEY_CONTROLPANEL,
};
unsigned int *code;
/* Wacom's keys are the only ones we now anything about */
if (libevdev_get_id_vendor(device->evdev) != VENDOR_ID_WACOM)
return;
/* We treat Wacom's KEY_PROG1..KEY_PROG3 special and map them into
* the ranges of the later Wacom devices. They have the same icon on
* the physical hardware, so let's not make every caller handle both
* cases.
*/
if (libevdev_has_event_code(device->evdev, EV_KEY, KEY_PROG1))
map_set_key_map(pad->button_map[KEY_PROG1],
KEY_BUTTONCONFIG);
if (libevdev_has_event_code(device->evdev, EV_KEY, KEY_PROG2))
map_set_key_map(pad->button_map[KEY_PROG2],
KEY_ONSCREEN_KEYBOARD);
if (libevdev_has_event_code(device->evdev, EV_KEY, KEY_PROG3))
map_set_key_map(pad->button_map[KEY_PROG3],
KEY_CONTROLPANEL);
code = KEY_BUTTONCONFIG;
if (libevdev_has_event_code(device->evdev, EV_KEY, code))
map_set_key_map(pad->button_map[code], code);
code = KEY_ONSCREEN_KEYBOARD;
if (libevdev_has_event_code(device->evdev, EV_KEY, code))
map_set_key_map(pad->button_map[code], code);
code = KEY_CONTROLPANEL;
if (libevdev_has_event_code(device->evdev, EV_KEY, code))
map_set_key_map(pad->button_map[code], code);
ARRAY_FOR_EACH(codes, code) {
if (libevdev_has_event_code(device->evdev, EV_KEY, *code))
map_set_key_map(pad->button_map[*code], *code);
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment