switch(buttonMask) { default: printf("buttonMask[%02X]\n",buttonMask); break; case BUTTON_RELEASE: switch(prev_click) { case BUTTON_L_DOWN: printf("BUTTON_L_DOWN BUTTON_RELEASE\n"); prev_click = -1; emit(fd_touch, EV_ABS, ABS_MT_TRACKING_ID, -1); emit(fd_touch, EV_SYN, SYN_REPORT, 0); break; } break;
case BUTTON_L_DOWN: if(prev_click == -1) { printf("BUTTON_L_DOWN\n"); prev_click = buttonMask; emit(fd_touch, EV_ABS, ABS_MT_SLOT, 0); emit(fd_touch, EV_ABS, ABS_MT_TRACKING_ID, track_id++); emit(fd_touch, EV_ABS, ABS_MT_POSITION_X, pos_x); emit(fd_touch, EV_ABS, ABS_MT_POSITION_Y, pos_y); emit(fd_touch, EV_ABS, ABS_X, pos_x); emit(fd_touch, EV_ABS, ABS_Y, pos_y); emit(fd_touch, EV_SYN, SYN_REPORT, 0); } else { printf("BUTTON_L_DOWN MOVE\n"); emit(fd_touch, EV_ABS, ABS_MT_SLOT, 0); emit(fd_touch, EV_ABS, ABS_MT_POSITION_X, pos_x); emit(fd_touch, EV_ABS, ABS_MT_POSITION_Y, pos_y); emit(fd_touch, EV_ABS, ABS_X, pos_x); emit(fd_touch, EV_ABS, ABS_Y, pos_y); emit(fd_touch, EV_SYN, SYN_REPORT, 0); } break; } |