/* * this function is called when a whole packet has been received and processed, * so that it can decide what to send to the input layer. */ static void mt_emit_event(struct mt_device *td, struct input_dev *input) { int i; for (i = 0; i < td->mtclass->maxcontacts; ++i) { struct mt_slot *s = &(td->slots[i]); if ((td->mtclass->quirks & MT_QUIRK_NOT_SEEN_MEANS_UP) && !s->seen_in_this_frame) { s->touch_state = false; } input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, s->touch_state); if (s->touch_state) { input_event(input, EV_ABS, ABS_MT_POSITION_X, s->x); input_event(input, EV_ABS, ABS_MT_POSITION_Y, s->y); input_event(input, EV_ABS, ABS_MT_PRESSURE, s->p); input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, s->w); input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, s->h); } s->seen_in_this_frame = false; } input_mt_report_pointer_emulation(input, true); input_sync(input); td->num_received = 0; }
/* * this function is called when a whole finger has been parsed, * so that it can decide what to send to the input layer. */ static void egalax_filter_event(struct egalax_data *td, struct input_dev *input) { input_mt_slot(input, td->slot); input_mt_report_slot_state(input, MT_TOOL_FINGER, td->touch); if (td->touch) { input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x); input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y); input_event(input, EV_ABS, ABS_MT_PRESSURE, td->z); } input_mt_report_pointer_emulation(input, true); }
static void pm_mtevent(struct pm *pm, struct input_dev *input) { int i; for (i = 0; i < pm->maxcontacts; ++i) { input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, pm->slots[i].active); if (pm->slots[i].active) { input_event(input, EV_ABS, ABS_MT_POSITION_X, pm->slots[i].x); input_event(input, EV_ABS, ABS_MT_POSITION_Y, pm->slots[i].y); } } input_mt_report_pointer_emulation(input, true); input_sync(input); }
/** * input_mt_sync_frame() - synchronize mt frame * @dev: input device with allocated MT slots * * Close the frame and prepare the internal state for a new one. * Depending on the flags, marks unused slots as inactive and performs * pointer emulation. */ void input_mt_sync_frame(struct input_dev *dev) { struct input_mt *mt = dev->mt; bool use_count = false; if (!mt) return; if (mt->flags & INPUT_MT_DROP_UNUSED) __input_mt_drop_unused(dev, mt); if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) use_count = true; input_mt_report_pointer_emulation(dev, use_count); mt->frame++; }
static void report_one_object(struct f12_data *f12, struct rmi_f12_object_data *object, int slot) { struct input_dev *input = f12->rmi_input->input_dev; struct rmi_input_abs_pos abs; //if (object->type == F12_OBJECT_PALM && f12->has_ACM25) return; memset(&abs, 0, sizeof(struct rmi_input_abs_pos)); abs.type = object->type; abs.n_finger = slot; abs.tool_type = get_tool_type(object); if (object->type) { abs.w_x = object->wx; abs.w_y = object->wy; abs.w_min = abs.w_x; abs.w_max = abs.w_y; abs.y = le16_to_cpu(object->pos_y); abs.x = le16_to_cpu(object->pos_x); abs.z = object->z; abs.orient = abs.w_x > abs.w_y; /* flip y! shoudl really have some axis swapping setting like f11 */ abs.y = max(f12->y_max - abs.y, 0); if (object->wx > object->wy) { abs.w_min = object->wy; abs.w_max = object->wx; } rmi_input_report_abs(f12->rmi_input, &abs); if (f12->sensor_type == rmi_sensor_touchpad) input_mt_report_pointer_emulation(input, true); #if 0 pr_debug( "finger[%d]:%d - x:%d y:%d z:%d wx:%d wy:%d\n", slot, object->type, abs.x, abs.y, abs.z, abs.w_x, abs.w_y); #endif } else { rmi_input_report_state(f12->rmi_input, RMI_INPUT_NO_FINGER, &abs); } }
void vinput_multi_tc_event_report(void *data) { struct multi_touch_info *info = NULL; int i = 0; info = (struct multi_touch_info *)data; if (info->fingernr > 0) { if (info->fingernr > MAX_FINGER_NUM) info->fingernr = MAX_FINGER_NUM; for (i = 0; i < info->fingernr; i++) { input_mt_slot(vinput_multi_tc_dev, i); if (1 == info->finger[i].press) { input_mt_report_slot_state(vinput_multi_tc_dev, MT_TOOL_FINGER, true); input_report_key(vinput_multi_tc_dev, ABS_MT_TRACKING_ID, i); input_report_abs(vinput_multi_tc_dev, ABS_MT_POSITION_X, info->finger[i].x); input_report_abs(vinput_multi_tc_dev, ABS_MT_POSITION_Y, info->finger[i].y); } else { input_mt_report_slot_state(vinput_multi_tc_dev, MT_TOOL_FINGER, false); } } if (1 == info->fingernr) { input_mt_slot(vinput_multi_tc_dev, 1); input_mt_report_slot_state(vinput_multi_tc_dev, MT_TOOL_FINGER, false); } input_mt_report_pointer_emulation(vinput_multi_tc_dev, true); input_sync(vinput_multi_tc_dev); } }
/** * input_mt_sync_frame() - synchronize mt frame * @dev: input device with allocated MT slots * * Close the frame and prepare the internal state for a new one. * Depending on the flags, marks unused slots as inactive and performs * pointer emulation. */ void input_mt_sync_frame(struct input_dev *dev) { struct input_mt *mt = dev->mt; struct input_mt_slot *s; if (!mt) return; if (mt->flags & INPUT_MT_DROP_UNUSED) { for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { if (input_mt_is_used(mt, s)) continue; input_mt_slot(dev, s - mt->slots); input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1); } } input_mt_report_pointer_emulation(dev, (mt->flags & INPUT_MT_POINTER)); mt->frame++; }
void wacom_mt_report_pointer_emulation(void *wcombo, bool value) { input_mt_report_pointer_emulation(get_input_dev(wcombo), value); }