Lines Matching refs:device
36 struct evdev_device *device, in fallback_keyboard_notify_key() argument
43 down_count = evdev_update_key_down_count(device, key, state); in fallback_keyboard_notify_key()
47 keyboard_notify_key(&device->base, time, key, state); in fallback_keyboard_notify_key()
52 struct evdev_device *device, in fallback_lid_notify_toggle() argument
56 switch_notify_toggle(&device->base, in fallback_lid_notify_toggle()
84 normalize_delta(struct evdev_device *device, in normalize_delta() argument
88 normalized->x = delta->x * DEFAULT_MOUSE_DPI / (double)device->dpi; in normalize_delta()
89 normalized->y = delta->y * DEFAULT_MOUSE_DPI / (double)device->dpi; in normalize_delta()
93 post_trackpoint_scroll(struct evdev_device *device, in post_trackpoint_scroll() argument
97 if (device->scroll.method != LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) in post_trackpoint_scroll()
100 switch(device->scroll.button_scroll_state) { in post_trackpoint_scroll()
107 evdev_log_debug(device, "btnscroll: discarding\n"); in post_trackpoint_scroll()
110 device->scroll.button_scroll_state = BUTTONSCROLL_SCROLLING; in post_trackpoint_scroll()
113 evdev_post_scroll(device, time, in post_trackpoint_scroll()
124 struct evdev_device *device, in fallback_filter_defuzz_touch() argument
148 struct evdev_device *device) in fallback_rotate_relative() argument
152 if (!device->base.config.rotation) in fallback_rotate_relative()
164 struct evdev_device *device, in fallback_flush_relative_motion() argument
167 struct libinput_device *base = &device->base; in fallback_flush_relative_motion()
171 if (!(device->seat_caps & EVDEV_DEVICE_POINTER)) in fallback_flush_relative_motion()
174 fallback_rotate_relative(dispatch, device); in fallback_flush_relative_motion()
176 normalize_delta(device, &dispatch->rel, &unaccel); in fallback_flush_relative_motion()
183 if (post_trackpoint_scroll(device, unaccel, time)) in fallback_flush_relative_motion()
186 if (device->pointer.filter) { in fallback_flush_relative_motion()
188 accel = filter_dispatch(device->pointer.filter, in fallback_flush_relative_motion()
190 device, in fallback_flush_relative_motion()
193 evdev_log_bug_libinput(device, in fallback_flush_relative_motion()
206 struct evdev_device *device, in fallback_flush_wheels() argument
212 if (!(device->seat_caps & EVDEV_DEVICE_POINTER)) in fallback_flush_wheels()
215 if (device->model_flags & EVDEV_MODEL_LENOVO_SCROLLPOINT) { in fallback_flush_wheels()
219 normalize_delta(device, &dispatch->wheel, &unaccel); in fallback_flush_wheels()
220 evdev_post_scroll(device, in fallback_flush_wheels()
232 device->scroll.wheel_click_angle.y; in fallback_flush_wheels()
236 device, in fallback_flush_wheels()
247 device->scroll.wheel_click_angle.x; in fallback_flush_wheels()
251 device, in fallback_flush_wheels()
263 struct evdev_device *device, in fallback_flush_absolute_motion() argument
266 struct libinput_device *base = &device->base; in fallback_flush_absolute_motion()
269 if (!(device->seat_caps & EVDEV_DEVICE_POINTER)) in fallback_flush_absolute_motion()
273 evdev_transform_absolute(device, &point); in fallback_flush_absolute_motion()
280 struct evdev_device *device, in fallback_flush_mt_down() argument
284 struct libinput_device *base = &device->base; in fallback_flush_mt_down()
290 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_mt_down()
295 evdev_log_bug_kernel(device, in fallback_flush_mt_down()
309 evdev_transform_absolute(device, &point); in fallback_flush_mt_down()
319 struct evdev_device *device, in fallback_flush_mt_motion() argument
323 struct libinput_device *base = &device->base; in fallback_flush_mt_motion()
328 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_mt_motion()
338 if (fallback_filter_defuzz_touch(dispatch, device, slot)) in fallback_flush_mt_motion()
341 evdev_transform_absolute(device, &point); in fallback_flush_mt_motion()
350 struct evdev_device *device, in fallback_flush_mt_up() argument
354 struct libinput_device *base = &device->base; in fallback_flush_mt_up()
359 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_mt_up()
378 struct evdev_device *device, in fallback_flush_mt_cancel() argument
382 struct libinput_device *base = &device->base; in fallback_flush_mt_cancel()
387 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_mt_cancel()
406 struct evdev_device *device, in fallback_flush_st_down() argument
409 struct libinput_device *base = &device->base; in fallback_flush_st_down()
414 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_st_down()
418 evdev_log_bug_kernel(device, in fallback_flush_st_down()
432 evdev_transform_absolute(device, &point); in fallback_flush_st_down()
441 struct evdev_device *device, in fallback_flush_st_motion() argument
444 struct libinput_device *base = &device->base; in fallback_flush_st_motion()
449 evdev_transform_absolute(device, &point); in fallback_flush_st_motion()
463 struct evdev_device *device, in fallback_flush_st_up() argument
466 struct libinput_device *base = &device->base; in fallback_flush_st_up()
470 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_st_up()
488 struct evdev_device *device, in fallback_flush_st_cancel() argument
491 struct libinput_device *base = &device->base; in fallback_flush_st_cancel()
495 if (!(device->seat_caps & EVDEV_DEVICE_TOUCH)) in fallback_flush_st_cancel()
513 struct evdev_device *device, in fallback_process_touch_button() argument
523 struct evdev_device *device, in fallback_process_key() argument
533 if (!device->is_mt) in fallback_process_key()
535 device, in fallback_process_key()
567 device, in fallback_process_key()
580 struct evdev_device *device, in fallback_process_touch() argument
588 evdev_log_bug_libinput(device, in fallback_process_touch()
605 v = libevdev_get_slot_value(device->evdev, in fallback_process_touch()
627 evdev_device_check_abs_axis_range(device, e->code, e->value); in fallback_process_touch()
633 evdev_device_check_abs_axis_range(device, e->code, e->value); in fallback_process_touch()
663 struct evdev_device *device, in fallback_process_absolute_motion() argument
668 evdev_device_check_abs_axis_range(device, e->code, e->value); in fallback_process_absolute_motion()
673 evdev_device_check_abs_axis_range(device, e->code, e->value); in fallback_process_absolute_motion()
694 int fd = libevdev_get_fd(dispatch->device->evdev); in fallback_lid_keyboard_event()
704 evdev_log_error(dispatch->device, in fallback_lid_keyboard_event()
717 fallback_lid_notify_toggle(dispatch, dispatch->device, time); in fallback_lid_keyboard_event()
725 assert(kbd->device); in fallback_lid_toggle_keyboard_listener()
731 &kbd->device->base, in fallback_lid_toggle_keyboard_listener()
747 if (!kbd->device) in fallback_lid_toggle_keyboard_listeners()
758 struct evdev_device *device, in fallback_process_switch() argument
777 fallback_lid_notify_toggle(dispatch, device, time); in fallback_process_switch()
788 switch_notify_toggle(&device->base, in fallback_process_switch()
797 fallback_reject_relative(struct evdev_device *device, in fallback_reject_relative() argument
802 (device->seat_caps & EVDEV_DEVICE_POINTER) == 0) { in fallback_reject_relative()
803 evdev_log_bug_libinput_ratelimit(device, in fallback_reject_relative()
804 &device->nonpointer_rel_limit, in fallback_reject_relative()
814 struct evdev_device *device, in fallback_process_relative() argument
817 if (fallback_reject_relative(device, e, time)) in fallback_process_relative()
842 struct evdev_device *device, in fallback_process_absolute() argument
846 if (device->is_mt) { in fallback_process_absolute()
847 fallback_process_touch(dispatch, device, e, time); in fallback_process_absolute()
849 fallback_process_absolute_motion(dispatch, device, e); in fallback_process_absolute()
855 struct evdev_device *device) in fallback_any_button_down() argument
860 if (libevdev_has_event_code(device->evdev, EV_KEY, button) && in fallback_any_button_down()
884 struct evdev_device *device, in fallback_flush_mt_events() argument
904 device, in fallback_flush_mt_events()
914 device, in fallback_flush_mt_events()
921 device, in fallback_flush_mt_events()
927 device, in fallback_flush_mt_events()
959 struct evdev_device *device, in fallback_handle_state() argument
966 fallback_flush_relative_motion(dispatch, device, time); in fallback_handle_state()
970 if (fallback_flush_st_down(dispatch, device, time)) in fallback_handle_state()
973 if (device->seat_caps & EVDEV_DEVICE_TOUCH) { in fallback_handle_state()
975 device, in fallback_handle_state()
978 } else if (device->seat_caps & EVDEV_DEVICE_POINTER) { in fallback_handle_state()
980 device, in fallback_handle_state()
986 if (fallback_flush_st_up(dispatch, device, time)) in fallback_handle_state()
993 device, in fallback_handle_state()
997 touch_notify_frame(&device->base, time); in fallback_handle_state()
999 fallback_flush_wheels(dispatch, device, time); in fallback_handle_state()
1025 struct evdev_device *device, in fallback_interface_process() argument
1036 fallback_process_relative(dispatch, device, event, time); in fallback_interface_process()
1039 fallback_process_absolute(dispatch, device, event, time); in fallback_interface_process()
1042 fallback_process_key(dispatch, device, event, time); in fallback_interface_process()
1045 fallback_process_switch(dispatch, device, event, time); in fallback_interface_process()
1048 fallback_handle_state(dispatch, device, time); in fallback_interface_process()
1055 struct evdev_device *device, in cancel_touches() argument
1064 device, in cancel_touches()
1074 fallback_flush_mt_cancel(dispatch, device, idx, time)) in cancel_touches()
1079 touch_notify_frame(&device->base, time); in cancel_touches()
1084 struct evdev_device *device, in release_pressed_keys() argument
1090 int count = get_key_down_count(device, code); in release_pressed_keys()
1096 evdev_log_bug_libinput(device, in release_pressed_keys()
1108 device, in release_pressed_keys()
1115 device, in release_pressed_keys()
1117 evdev_to_left_handed(device, code), in release_pressed_keys()
1122 count = get_key_down_count(device, code); in release_pressed_keys()
1124 evdev_log_bug_libinput(device, in release_pressed_keys()
1134 struct evdev_device *device) in fallback_return_to_neutral_state() argument
1136 struct libinput *libinput = evdev_libinput_context(device); in fallback_return_to_neutral_state()
1142 cancel_touches(dispatch, device, NULL, time); in fallback_return_to_neutral_state()
1143 release_pressed_keys(dispatch, device, time); in fallback_return_to_neutral_state()
1150 struct evdev_device *device) in fallback_interface_suspend() argument
1154 fallback_return_to_neutral_state(dispatch, device); in fallback_interface_suspend()
1178 fallback_interface_sync_initial_state(struct evdev_device *device, in fallback_interface_sync_initial_state() argument
1182 uint64_t time = libinput_now(evdev_libinput_context(device)); in fallback_interface_sync_initial_state()
1184 if (device->tags & EVDEV_TAG_LID_SWITCH) { in fallback_interface_sync_initial_state()
1185 struct libevdev *evdev = device->evdev; in fallback_interface_sync_initial_state()
1201 fallback_lid_notify_toggle(dispatch, device, time); in fallback_interface_sync_initial_state()
1206 switch_notify_toggle(&device->base, in fallback_interface_sync_initial_state()
1215 struct evdev_device *device, in fallback_interface_update_rect() argument
1227 rect = evdev_phys_rect_to_units(device, phys_rect); in fallback_interface_update_rect()
1233 struct evdev_device *device, in fallback_interface_toggle_touch() argument
1258 rect = evdev_phys_rect_to_units(device, phys_rect); in fallback_interface_toggle_touch()
1259 cancel_touches(dispatch, device, &rect, time); in fallback_interface_toggle_touch()
1264 fallback_return_to_neutral_state(dispatch, device); in fallback_interface_toggle_touch()
1311 kbd->device = keyboard; in fallback_lid_pair_keyboard()
1329 struct evdev_device *device) in fallback_resume() argument
1335 evdev_device_resume(device); in fallback_resume()
1340 struct evdev_device *device) in fallback_suspend() argument
1342 evdev_device_suspend(device); in fallback_suspend()
1351 struct evdev_device *device = dispatch->device; in fallback_tablet_mode_switch_event() local
1364 fallback_resume(dispatch, device); in fallback_tablet_mode_switch_event()
1365 evdev_log_debug(device, "tablet-mode: resuming device\n"); in fallback_tablet_mode_switch_event()
1368 fallback_suspend(dispatch, device); in fallback_tablet_mode_switch_event()
1369 evdev_log_debug(device, "tablet-mode: suspending device\n"); in fallback_tablet_mode_switch_event()
1423 fallback_interface_device_added(struct evdev_device *device, in fallback_interface_device_added() argument
1426 fallback_lid_pair_keyboard(device, added_device); in fallback_interface_device_added()
1427 fallback_pair_tablet_mode(device, added_device); in fallback_interface_device_added()
1431 fallback_interface_device_removed(struct evdev_device *device, in fallback_interface_device_removed() argument
1435 fallback_dispatch(device->dispatch); in fallback_interface_device_removed()
1442 if (!kbd->device) in fallback_interface_device_removed()
1445 if (kbd->device != removed_device) in fallback_interface_device_removed()
1476 fallback_change_to_left_handed(struct evdev_device *device) in fallback_change_to_left_handed() argument
1478 struct fallback_dispatch *dispatch = fallback_dispatch(device->dispatch); in fallback_change_to_left_handed()
1480 if (device->left_handed.want_enabled == device->left_handed.enabled) in fallback_change_to_left_handed()
1483 if (fallback_any_button_down(dispatch, device)) in fallback_change_to_left_handed()
1486 device->left_handed.enabled = device->left_handed.want_enabled; in fallback_change_to_left_handed()
1490 fallback_change_scroll_method(struct evdev_device *device) in fallback_change_scroll_method() argument
1492 struct fallback_dispatch *dispatch = fallback_dispatch(device->dispatch); in fallback_change_scroll_method()
1494 if (device->scroll.want_method == device->scroll.method && in fallback_change_scroll_method()
1495 device->scroll.want_button == device->scroll.button && in fallback_change_scroll_method()
1496 device->scroll.want_lock_enabled == device->scroll.lock_enabled) in fallback_change_scroll_method()
1499 if (fallback_any_button_down(dispatch, device)) in fallback_change_scroll_method()
1502 device->scroll.method = device->scroll.want_method; in fallback_change_scroll_method()
1503 device->scroll.button = device->scroll.want_button; in fallback_change_scroll_method()
1504 device->scroll.lock_enabled = device->scroll.want_lock_enabled; in fallback_change_scroll_method()
1505 evdev_set_button_scroll_lock_enabled(device, device->scroll.lock_enabled); in fallback_change_scroll_method()
1509 fallback_rotation_config_is_available(struct libinput_device *device) in fallback_rotation_config_is_available() argument
1519 struct evdev_device *device = evdev_device(libinput_device); in fallback_rotation_config_set_angle() local
1520 struct fallback_dispatch *dispatch = fallback_dispatch(device->dispatch); in fallback_rotation_config_set_angle()
1531 struct evdev_device *device = evdev_device(libinput_device); in fallback_rotation_config_get_angle() local
1532 struct fallback_dispatch *dispatch = fallback_dispatch(device->dispatch); in fallback_rotation_config_get_angle()
1538 fallback_rotation_config_get_default_angle(struct libinput_device *device) in fallback_rotation_config_get_default_angle() argument
1545 struct evdev_device *device) in fallback_init_rotation() argument
1547 if ((device->model_flags & EVDEV_MODEL_TRACKBALL) == 0) in fallback_init_rotation()
1556 device->base.config.rotation = &dispatch->rotation.config; in fallback_init_rotation()
1561 struct evdev_device *device) in fallback_dispatch_init_slots() argument
1563 struct libevdev *evdev = device->evdev; in fallback_dispatch_init_slots()
1569 if (evdev_is_fake_mt_device(device) || in fallback_dispatch_init_slots()
1577 if (evdev_need_mtdev(device)) { in fallback_dispatch_init_slots()
1578 device->mtdev = mtdev_new_open(device->fd); in fallback_dispatch_init_slots()
1579 if (!device->mtdev) in fallback_dispatch_init_slots()
1585 active_slot = device->mtdev->caps.slot.value; in fallback_dispatch_init_slots()
1587 num_slots = libevdev_get_num_slots(device->evdev); in fallback_dispatch_init_slots()
1596 if (evdev_need_mtdev(device)) in fallback_dispatch_init_slots()
1613 if (device->abs.absinfo_x->fuzz || device->abs.absinfo_y->fuzz) { in fallback_dispatch_init_slots()
1615 dispatch->mt.hysteresis_margin.x = device->abs.absinfo_x->fuzz/2; in fallback_dispatch_init_slots()
1616 dispatch->mt.hysteresis_margin.y = device->abs.absinfo_y->fuzz/2; in fallback_dispatch_init_slots()
1624 struct evdev_device *device) in fallback_dispatch_init_rel() argument
1632 struct evdev_device *device) in fallback_dispatch_init_abs() argument
1634 if (!libevdev_has_event_code(device->evdev, EV_ABS, ABS_X)) in fallback_dispatch_init_abs()
1637 dispatch->abs.point.x = device->abs.absinfo_x->value; in fallback_dispatch_init_abs()
1638 dispatch->abs.point.y = device->abs.absinfo_y->value; in fallback_dispatch_init_abs()
1641 evdev_device_init_abs_range_warnings(device); in fallback_dispatch_init_abs()
1646 struct evdev_device *device) in fallback_dispatch_init_switch() argument
1652 if (device->tags & EVDEV_TAG_LID_SWITCH) { in fallback_dispatch_init_switch()
1653 dispatch->lid.reliability = evdev_read_switch_reliability_prop(device); in fallback_dispatch_init_switch()
1657 if (device->tags & EVDEV_TAG_TABLET_MODE_SWITCH) { in fallback_dispatch_init_switch()
1658 val = libevdev_get_event_value(device->evdev, in fallback_dispatch_init_switch()
1678 struct evdev_device *device) in fallback_init_arbitration() argument
1685 evdev_device_get_sysname(device)); in fallback_init_arbitration()
1687 evdev_libinput_context(device), in fallback_init_arbitration()
1697 struct evdev_device *device = evdev_device(libinput_device); in fallback_dispatch_create() local
1701 dispatch->device = evdev_device(libinput_device); in fallback_dispatch_create()
1707 fallback_dispatch_init_rel(dispatch, device); in fallback_dispatch_create()
1708 fallback_dispatch_init_abs(dispatch, device); in fallback_dispatch_create()
1709 if (fallback_dispatch_init_slots(dispatch, device) == -1) { in fallback_dispatch_create()
1714 fallback_dispatch_init_switch(dispatch, device); in fallback_dispatch_create()
1716 if (device->left_handed.want_enabled) in fallback_dispatch_create()
1717 evdev_init_left_handed(device, in fallback_dispatch_create()
1720 if (device->scroll.want_button) in fallback_dispatch_create()
1721 evdev_init_button_scroll(device, in fallback_dispatch_create()
1724 if (device->scroll.natural_scrolling_enabled) in fallback_dispatch_create()
1725 evdev_init_natural_scroll(device); in fallback_dispatch_create()
1727 evdev_init_calibration(device, &dispatch->calibration); in fallback_dispatch_create()
1728 evdev_init_sendevents(device, &dispatch->base); in fallback_dispatch_create()
1729 fallback_init_rotation(dispatch, device); in fallback_dispatch_create()
1736 if (libevdev_has_event_code(device->evdev, EV_KEY, BTN_LEFT) && in fallback_dispatch_create()
1737 libevdev_has_event_code(device->evdev, EV_KEY, BTN_RIGHT)) { in fallback_dispatch_create()
1738 bool has_middle = libevdev_has_event_code(device->evdev, in fallback_dispatch_create()
1744 evdev_init_middlebutton(device, in fallback_dispatch_create()
1750 fallback_init_arbitration(dispatch, device); in fallback_dispatch_create()