399 } else { |
399 } else { |
400 /* This touchscreen does not support pressure */ |
400 /* This touchscreen does not support pressure */ |
401 norm_pressure = 1.0f; |
401 norm_pressure = 1.0f; |
402 } |
402 } |
403 |
403 |
|
404 /* FIXME: the touch's window shouldn't be null, but |
|
405 * the coordinate space of touch positions needs to |
|
406 * be window-relative in that case. */ |
404 switch(item->touchscreen_data->slots[j].delta) { |
407 switch(item->touchscreen_data->slots[j].delta) { |
405 case EVDEV_TOUCH_SLOTDELTA_DOWN: |
408 case EVDEV_TOUCH_SLOTDELTA_DOWN: |
406 SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_TRUE, norm_x, norm_y, norm_pressure); |
409 SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_TRUE, norm_x, norm_y, norm_pressure); |
407 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
410 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
408 break; |
411 break; |
409 case EVDEV_TOUCH_SLOTDELTA_UP: |
412 case EVDEV_TOUCH_SLOTDELTA_UP: |
410 SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_FALSE, norm_x, norm_y, norm_pressure); |
413 SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_FALSE, norm_x, norm_y, norm_pressure); |
411 item->touchscreen_data->slots[j].tracking_id = -1; |
414 item->touchscreen_data->slots[j].tracking_id = -1; |
412 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
415 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
413 break; |
416 break; |
414 case EVDEV_TOUCH_SLOTDELTA_MOVE: |
417 case EVDEV_TOUCH_SLOTDELTA_MOVE: |
415 SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, norm_x, norm_y, norm_pressure); |
418 SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, norm_x, norm_y, norm_pressure); |
416 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
419 item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; |
417 break; |
420 break; |
418 default: |
421 default: |
419 break; |
422 break; |
420 } |
423 } |