void multi_touch_session_end(struct ntrig_usbhid_data* nd) { clear_input_buffer(nd); nd->message.type = MSG_FINGER_PARSE; nd->message.msg.fingers_event.num_of_fingers = 0; nd->message.msg.fingers_event.frame_index = nd->frame_index; nd->message.msg.fingers_event.sensor_id = nd->sensor_id; if (WriteHIDNTRIG(&nd->message) != DTRG_NO_ERROR) ntrig_dbg("FAILED to end MULTI-TOUCH session\n"); }
void send_pen(struct ntrig_usbhid_data* nd) { clear_input_buffer(nd); nd->message.type = MSG_PEN_EVENTS; nd->message.msg.pen_event.x_coord = nd->x; nd->message.msg.pen_event.y_coord = nd->y; nd->message.msg.pen_event.pressure = nd->pressure; nd->message.msg.pen_event.btn_code = nd->btn_pressed; nd->message.msg.pen_event.btn_removed = nd->btn_removed; nd->message.msg.pen_event.sensor_id = nd->sensor_id; nd->message.msg.pen_event.battery_status = nd->battery_status; if (WriteHIDNTRIG(&nd->message) != DTRG_NO_ERROR) ntrig_dbg("FAILED to send PEN\n"); }
void process_multi_touch_finger(struct ntrig_usbhid_data* nd) { int index = nd->message.msg.fingers_event.num_of_fingers; if(0 == nd->finger_id){ /* start preparing finger report */ clear_input_buffer(nd); nd->message.type = MSG_FINGER_PARSE; index = 0; } nd->message.msg.fingers_event.finger_array[index].track_id = nd->finger_id; nd->message.msg.fingers_event.finger_array[index].x_coord = nd->x; nd->message.msg.fingers_event.finger_array[index].y_coord = nd->y; nd->message.msg.fingers_event.finger_array[index].dx = nd->dx; nd->message.msg.fingers_event.finger_array[index].dy = nd->dy; /* we pass generic byte via removed field */ nd->message.msg.fingers_event.finger_array[index].removed = nd->generic_byte; nd->message.msg.fingers_event.finger_array[index].palm = nd->isPalm; nd->message.msg.fingers_event.finger_array[index].generic = nd->blob_id; nd->message.msg.fingers_event.num_of_fingers++; }
static void input_process(pty_t * pty, uint8_t c) { if (pty->tios.c_lflag & ICANON) { debug_print(INFO, "Processing for character %d in canon mode", c); if (c == pty->tios.c_cc[VKILL]) { while (pty->canon_buflen > 0) { pty->canon_buflen--; pty->canon_buffer[pty->canon_buflen] = '\0'; if (pty->tios.c_lflag & ECHO) { output_process(pty, '\010'); output_process(pty, ' '); output_process(pty, '\010'); } } return; } if (c == pty->tios.c_cc[VERASE]) { /* Backspace */ if (pty->canon_buflen > 0) { pty->canon_buflen--; pty->canon_buffer[pty->canon_buflen] = '\0'; if (pty->tios.c_lflag & ECHO) { output_process(pty, '\010'); output_process(pty, ' '); output_process(pty, '\010'); } } return; } if (c == pty->tios.c_cc[VINTR]) { if (pty->tios.c_lflag & ECHO) { output_process(pty, '^'); output_process(pty, '@' + c); output_process(pty, '\n'); } clear_input_buffer(pty); if (pty->fg_proc) { send_signal(pty->fg_proc, SIGINT); } return; } if (c == pty->tios.c_cc[VQUIT]) { if (pty->tios.c_lflag & ECHO) { output_process(pty, '^'); output_process(pty, '@' + c); output_process(pty, '\n'); } clear_input_buffer(pty); if (pty->fg_proc) { send_signal(pty->fg_proc, SIGQUIT); } return; } pty->canon_buffer[pty->canon_buflen] = c; if (pty->tios.c_lflag & ECHO) { output_process(pty, c); } if (pty->canon_buffer[pty->canon_buflen] == '\n') { pty->canon_buflen++; dump_input_buffer(pty); return; } if (pty->canon_buflen == pty->canon_bufsize) { dump_input_buffer(pty); return; } pty->canon_buflen++; return; } else if (pty->tios.c_lflag & ECHO) { output_process(pty, c); } IN(c); }