Lines Matching refs:evdev

71 evdev_mt_init(struct evdev_dev *evdev)  in evdev_mt_init()  argument
75 slots = MAXIMAL_MT_SLOT(evdev) + 1; in evdev_mt_init()
77 evdev->ev_mt = malloc(offsetof(struct evdev_mt, ev_mt_slots) + in evdev_mt_init()
87 evdev->ev_mt->ev_mt_slots[slot] = (struct evdev_mt_slot) { in evdev_mt_init()
93 if (bit_test(evdev->ev_flags, EVDEV_FLAG_MT_STCOMPAT)) in evdev_mt_init()
94 evdev_support_mt_compat(evdev); in evdev_mt_init()
98 evdev_mt_free(struct evdev_dev *evdev) in evdev_mt_free() argument
101 free(evdev->ev_mt, M_EVDEV); in evdev_mt_free()
105 evdev_get_last_mt_slot(struct evdev_dev *evdev) in evdev_get_last_mt_slot() argument
108 return (evdev->ev_mt->ev_mt_last_reported_slot); in evdev_get_last_mt_slot()
112 evdev_set_last_mt_slot(struct evdev_dev *evdev, int32_t slot) in evdev_set_last_mt_slot() argument
115 evdev->ev_mt->ev_mt_slots[slot].ev_report = evdev->ev_report_count; in evdev_set_last_mt_slot()
116 evdev->ev_mt->ev_mt_last_reported_slot = slot; in evdev_set_last_mt_slot()
120 evdev_get_mt_value(struct evdev_dev *evdev, int32_t slot, int16_t code) in evdev_get_mt_value() argument
123 return (evdev->ev_mt-> in evdev_get_mt_value()
128 evdev_set_mt_value(struct evdev_dev *evdev, int32_t slot, int16_t code, in evdev_set_mt_value() argument
132 evdev->ev_mt->ev_mt_slots[slot].ev_mt_states[ABS_MT_INDEX(code)] = in evdev_set_mt_value()
137 evdev_get_mt_slot_by_tracking_id(struct evdev_dev *evdev, int32_t tracking_id) in evdev_get_mt_slot_by_tracking_id() argument
141 for (slot = 0; slot <= MAXIMAL_MT_SLOT(evdev); slot++) { in evdev_get_mt_slot_by_tracking_id()
142 tr_id = evdev_get_mt_value(evdev, slot, ABS_MT_TRACKING_ID); in evdev_get_mt_slot_by_tracking_id()
152 evdev->ev_mt->ev_mt_slots[slot].ev_report != in evdev_get_mt_slot_by_tracking_id()
153 evdev->ev_report_count) in evdev_get_mt_slot_by_tracking_id()
161 evdev_support_nfingers(struct evdev_dev *evdev, int32_t nfingers) in evdev_support_nfingers() argument
166 evdev_support_key(evdev, evdev_fngmap[i]); in evdev_support_nfingers()
170 evdev_support_mt_compat(struct evdev_dev *evdev) in evdev_support_mt_compat() argument
174 if (evdev->ev_absinfo == NULL) in evdev_support_mt_compat()
177 evdev_support_event(evdev, EV_KEY); in evdev_support_mt_compat()
178 evdev_support_key(evdev, BTN_TOUCH); in evdev_support_mt_compat()
181 if (!bit_test(evdev->ev_prop_flags, INPUT_PROP_DIRECT)) in evdev_support_mt_compat()
182 evdev_support_nfingers(evdev, MAXIMAL_MT_SLOT(evdev) + 1); in evdev_support_mt_compat()
186 if (bit_test(evdev->ev_abs_flags, evdev_mtstmap[i][0])) in evdev_support_mt_compat()
187 evdev_support_abs(evdev, evdev_mtstmap[i][1], in evdev_support_mt_compat()
188 evdev->ev_absinfo[evdev_mtstmap[i][0]].value, in evdev_support_mt_compat()
189 evdev->ev_absinfo[evdev_mtstmap[i][0]].minimum, in evdev_support_mt_compat()
190 evdev->ev_absinfo[evdev_mtstmap[i][0]].maximum, in evdev_support_mt_compat()
191 evdev->ev_absinfo[evdev_mtstmap[i][0]].fuzz, in evdev_support_mt_compat()
192 evdev->ev_absinfo[evdev_mtstmap[i][0]].flat, in evdev_support_mt_compat()
193 evdev->ev_absinfo[evdev_mtstmap[i][0]].resolution); in evdev_support_mt_compat()
197 evdev_count_fingers(struct evdev_dev *evdev) in evdev_count_fingers() argument
201 for (i = 0; i <= MAXIMAL_MT_SLOT(evdev); i++) in evdev_count_fingers()
202 if (evdev_get_mt_value(evdev, i, ABS_MT_TRACKING_ID) != -1) in evdev_count_fingers()
209 evdev_send_nfingers(struct evdev_dev *evdev, int32_t nfingers) in evdev_send_nfingers() argument
213 EVDEV_LOCK_ASSERT(evdev); in evdev_send_nfingers()
219 evdev_send_event(evdev, EV_KEY, evdev_fngmap[i], in evdev_send_nfingers()
224 evdev_push_nfingers(struct evdev_dev *evdev, int32_t nfingers) in evdev_push_nfingers() argument
227 EVDEV_ENTER(evdev); in evdev_push_nfingers()
228 evdev_send_nfingers(evdev, nfingers); in evdev_push_nfingers()
229 EVDEV_EXIT(evdev); in evdev_push_nfingers()
233 evdev_send_mt_compat(struct evdev_dev *evdev) in evdev_send_mt_compat() argument
237 EVDEV_LOCK_ASSERT(evdev); in evdev_send_mt_compat()
239 nfingers = evdev_count_fingers(evdev); in evdev_send_mt_compat()
240 evdev_send_event(evdev, EV_KEY, BTN_TOUCH, nfingers > 0); in evdev_send_mt_compat()
242 if (evdev_get_mt_value(evdev, 0, ABS_MT_TRACKING_ID) != -1) in evdev_send_mt_compat()
245 if (bit_test(evdev->ev_abs_flags, evdev_mtstmap[i][1])) in evdev_send_mt_compat()
246 evdev_send_event(evdev, EV_ABS, in evdev_send_mt_compat()
248 evdev_get_mt_value(evdev, 0, in evdev_send_mt_compat()
252 if (!bit_test(evdev->ev_prop_flags, INPUT_PROP_DIRECT)) in evdev_send_mt_compat()
253 evdev_send_nfingers(evdev, nfingers); in evdev_send_mt_compat()
256 evdev_send_event(evdev, EV_ABS, ABS_PRESSURE, 0); in evdev_send_mt_compat()
260 evdev_push_mt_compat(struct evdev_dev *evdev) in evdev_push_mt_compat() argument
263 EVDEV_ENTER(evdev); in evdev_push_mt_compat()
264 evdev_send_mt_compat(evdev); in evdev_push_mt_compat()
265 EVDEV_EXIT(evdev); in evdev_push_mt_compat()
269 evdev_send_mt_autorel(struct evdev_dev *evdev) in evdev_send_mt_autorel() argument
273 EVDEV_LOCK_ASSERT(evdev); in evdev_send_mt_autorel()
275 for (slot = 0; slot <= MAXIMAL_MT_SLOT(evdev); slot++) { in evdev_send_mt_autorel()
276 if (evdev->ev_mt->ev_mt_slots[slot].ev_report != in evdev_send_mt_autorel()
277 evdev->ev_report_count && in evdev_send_mt_autorel()
278 evdev_get_mt_value(evdev, slot, ABS_MT_TRACKING_ID) != -1){ in evdev_send_mt_autorel()
279 evdev_send_event(evdev, EV_ABS, ABS_MT_SLOT, slot); in evdev_send_mt_autorel()
280 evdev_send_event(evdev, EV_ABS, ABS_MT_TRACKING_ID, in evdev_send_mt_autorel()