Lines Matching refs:pad
40 pad_get_buttons_pressed(struct pad_dispatch *pad, in pad_get_buttons_pressed() argument
43 struct button_state *state = &pad->button_state; in pad_get_buttons_pressed()
44 struct button_state *prev_state = &pad->prev_button_state; in pad_get_buttons_pressed()
52 pad_get_buttons_released(struct pad_dispatch *pad, in pad_get_buttons_released() argument
55 struct button_state *state = &pad->button_state; in pad_get_buttons_released()
56 struct button_state *prev_state = &pad->prev_button_state; in pad_get_buttons_released()
64 pad_button_is_down(const struct pad_dispatch *pad, in pad_button_is_down() argument
67 return bit_is_set(pad->button_state.bits, button); in pad_button_is_down()
71 pad_any_button_down(const struct pad_dispatch *pad) in pad_any_button_down() argument
73 const struct button_state *state = &pad->button_state; in pad_any_button_down()
84 pad_button_set_down(struct pad_dispatch *pad, in pad_button_set_down() argument
88 struct button_state *state = &pad->button_state; in pad_button_set_down()
92 pad_set_status(pad, PAD_BUTTONS_PRESSED); in pad_button_set_down()
95 pad_set_status(pad, PAD_BUTTONS_RELEASED); in pad_button_set_down()
100 pad_process_absolute(struct pad_dispatch *pad, in pad_process_absolute() argument
107 pad->changed_axes |= PAD_AXIS_RING1; in pad_process_absolute()
108 pad_set_status(pad, PAD_AXES_UPDATED); in pad_process_absolute()
111 pad->changed_axes |= PAD_AXIS_RING2; in pad_process_absolute()
112 pad_set_status(pad, PAD_AXES_UPDATED); in pad_process_absolute()
115 pad->changed_axes |= PAD_AXIS_STRIP1; in pad_process_absolute()
116 pad_set_status(pad, PAD_AXES_UPDATED); in pad_process_absolute()
119 pad->changed_axes |= PAD_AXIS_STRIP2; in pad_process_absolute()
120 pad_set_status(pad, PAD_AXES_UPDATED); in pad_process_absolute()
137 pad->have_abs_misc_terminator = true; in pad_process_absolute()
178 pad_handle_ring(struct pad_dispatch *pad, in pad_handle_ring() argument
197 pad_handle_strip(struct pad_dispatch *pad, in pad_handle_strip() argument
219 pad_ring_get_mode_group(struct pad_dispatch *pad, in pad_ring_get_mode_group() argument
224 list_for_each(group, &pad->modes.mode_group_list, link) { in pad_ring_get_mode_group()
235 pad_strip_get_mode_group(struct pad_dispatch *pad, in pad_strip_get_mode_group() argument
240 list_for_each(group, &pad->modes.mode_group_list, link) { in pad_strip_get_mode_group()
251 pad_check_notify_axes(struct pad_dispatch *pad, in pad_check_notify_axes() argument
262 if (pad->have_abs_misc_terminator && in pad_check_notify_axes()
266 if (pad->changed_axes & PAD_AXIS_RING1) { in pad_check_notify_axes()
267 value = pad_handle_ring(pad, device, ABS_WHEEL); in pad_check_notify_axes()
271 group = pad_ring_get_mode_group(pad, 0); in pad_check_notify_axes()
280 if (pad->changed_axes & PAD_AXIS_RING2) { in pad_check_notify_axes()
281 value = pad_handle_ring(pad, device, ABS_THROTTLE); in pad_check_notify_axes()
285 group = pad_ring_get_mode_group(pad, 1); in pad_check_notify_axes()
294 if (pad->changed_axes & PAD_AXIS_STRIP1) { in pad_check_notify_axes()
295 value = pad_handle_strip(pad, device, ABS_RX); in pad_check_notify_axes()
299 group = pad_strip_get_mode_group(pad, 0); in pad_check_notify_axes()
308 if (pad->changed_axes & PAD_AXIS_STRIP2) { in pad_check_notify_axes()
309 value = pad_handle_strip(pad, device, ABS_RY); in pad_check_notify_axes()
313 group = pad_strip_get_mode_group(pad, 1); in pad_check_notify_axes()
322 pad->changed_axes = PAD_AXIS_NONE; in pad_check_notify_axes()
323 pad->have_abs_misc_terminator = false; in pad_check_notify_axes()
327 pad_process_key(struct pad_dispatch *pad, in pad_process_key() argument
339 pad_button_set_down(pad, button, is_press); in pad_process_key()
343 pad_button_get_mode_group(struct pad_dispatch *pad, in pad_button_get_mode_group() argument
348 list_for_each(group, &pad->modes.mode_group_list, link) { in pad_button_get_mode_group()
359 pad_notify_button_mask(struct pad_dispatch *pad, in pad_notify_button_mask() argument
385 map = pad->button_map[code - 1]; in pad_notify_button_mask()
392 group = pad_button_get_mode_group(pad, button); in pad_notify_button_mask()
414 pad_notify_buttons(struct pad_dispatch *pad, in pad_notify_buttons() argument
422 pad_get_buttons_pressed(pad, &buttons); in pad_notify_buttons()
424 pad_get_buttons_released(pad, &buttons); in pad_notify_buttons()
426 pad_notify_button_mask(pad, device, time, &buttons, state); in pad_notify_buttons()
432 struct pad_dispatch *pad = (struct pad_dispatch*)device->dispatch; in pad_change_to_left_handed() local
437 if (pad_any_button_down(pad)) in pad_change_to_left_handed()
444 pad_flush(struct pad_dispatch *pad, in pad_flush() argument
448 if (pad_has_status(pad, PAD_AXES_UPDATED)) { in pad_flush()
449 pad_check_notify_axes(pad, device, time); in pad_flush()
450 pad_unset_status(pad, PAD_AXES_UPDATED); in pad_flush()
453 if (pad_has_status(pad, PAD_BUTTONS_RELEASED)) { in pad_flush()
454 pad_notify_buttons(pad, in pad_flush()
458 pad_unset_status(pad, PAD_BUTTONS_RELEASED); in pad_flush()
463 if (pad_has_status(pad, PAD_BUTTONS_PRESSED)) { in pad_flush()
464 pad_notify_buttons(pad, in pad_flush()
468 pad_unset_status(pad, PAD_BUTTONS_PRESSED); in pad_flush()
472 memcpy(&pad->prev_button_state, in pad_flush()
473 &pad->button_state, in pad_flush()
474 sizeof(pad->button_state)); in pad_flush()
483 struct pad_dispatch *pad = pad_dispatch(dispatch); in pad_process() local
487 pad_process_absolute(pad, device, e, time); in pad_process()
490 pad_process_key(pad, device, e, time); in pad_process()
493 pad_flush(pad, device, time); in pad_process()
512 struct pad_dispatch *pad = pad_dispatch(dispatch); in pad_suspend() local
513 struct libinput *libinput = pad_libinput_context(pad); in pad_suspend()
517 if (pad_button_is_down(pad, code)) in pad_suspend()
518 pad_button_set_down(pad, code, false); in pad_suspend()
521 pad_flush(pad, device, libinput_now(libinput)); in pad_suspend()
527 struct pad_dispatch *pad = pad_dispatch(dispatch); in pad_destroy() local
529 pad_destroy_leds(pad); in pad_destroy()
530 free(pad); in pad_destroy()
549 pad_init_buttons_from_libwacom(struct pad_dispatch *pad, in pad_init_buttons_from_libwacom() argument
554 struct libinput *li = pad_libinput_context(pad); in pad_init_buttons_from_libwacom()
579 map_set_button_map(pad->button_map[code], map++); in pad_init_buttons_from_libwacom()
582 pad->nbuttons = map; in pad_init_buttons_from_libwacom()
595 pad_init_buttons_from_kernel(struct pad_dispatch *pad, in pad_init_buttons_from_kernel() argument
604 map_set_button_map(pad->button_map[code], map++); in pad_init_buttons_from_kernel()
609 map_set_button_map(pad->button_map[code], map++); in pad_init_buttons_from_kernel()
614 map_set_button_map(pad->button_map[code], map++); in pad_init_buttons_from_kernel()
619 map_set_button_map(pad->button_map[code], map++); in pad_init_buttons_from_kernel()
622 pad->nbuttons = map; in pad_init_buttons_from_kernel()
626 pad_init_keys(struct pad_dispatch *pad, struct evdev_device *device) in pad_init_keys() argument
641 map_set_key_map(pad->button_map[*code], *code); in pad_init_keys()
646 pad_init_buttons(struct pad_dispatch *pad, in pad_init_buttons() argument
651 for (i = 0; i < ARRAY_LENGTH(pad->button_map); i++) in pad_init_buttons()
652 map_init(pad->button_map[i]); in pad_init_buttons()
654 if (!pad_init_buttons_from_libwacom(pad, device)) in pad_init_buttons()
655 pad_init_buttons_from_kernel(pad, device); in pad_init_buttons()
657 pad_init_keys(pad, device); in pad_init_buttons()
669 pad_init(struct pad_dispatch *pad, struct evdev_device *device) in pad_init() argument
671 pad->base.dispatch_type = DISPATCH_TABLET_PAD; in pad_init()
672 pad->base.interface = &pad_interface; in pad_init()
673 pad->device = device; in pad_init()
674 pad->status = PAD_NONE; in pad_init()
675 pad->changed_axes = PAD_AXIS_NONE; in pad_init()
677 pad_init_buttons(pad, device); in pad_init()
679 if (pad_init_leds(pad, device) != 0) in pad_init()
696 struct pad_dispatch *pad = (struct pad_dispatch*)evdev->dispatch; in pad_sendevents_set_mode() local
698 if (mode == pad->sendevents.current_mode) in pad_sendevents_set_mode()
711 pad->sendevents.current_mode = mode; in pad_sendevents_set_mode()
734 struct pad_dispatch *pad; in evdev_tablet_pad_create() local
736 pad = zalloc(sizeof *pad); in evdev_tablet_pad_create()
738 if (pad_init(pad, device) != 0) { in evdev_tablet_pad_create()
739 pad_destroy(&pad->base); in evdev_tablet_pad_create()
743 device->base.config.sendevents = &pad->sendevents.config; in evdev_tablet_pad_create()
744 pad->sendevents.current_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; in evdev_tablet_pad_create()
745 pad->sendevents.config.get_modes = pad_sendevents_get_modes; in evdev_tablet_pad_create()
746 pad->sendevents.config.set_mode = pad_sendevents_set_mode; in evdev_tablet_pad_create()
747 pad->sendevents.config.get_mode = pad_sendevents_get_mode; in evdev_tablet_pad_create()
748 pad->sendevents.config.get_default_mode = pad_sendevents_get_default_mode; in evdev_tablet_pad_create()
750 return &pad->base; in evdev_tablet_pad_create()
765 struct pad_dispatch *pad = (struct pad_dispatch*)device->dispatch; in evdev_device_tablet_pad_get_num_buttons() local
770 return pad->nbuttons; in evdev_device_tablet_pad_get_num_buttons()