mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 05:53:12 -07:00
Finish Motion in Setsu
This commit is contained in:
parent
698bce8022
commit
88c03aa744
5 changed files with 160 additions and 26 deletions
|
@ -80,13 +80,13 @@ void event(SetsuEvent *event, void *user)
|
|||
LOG("Device removed: %s\n", event->path);
|
||||
break;
|
||||
case SETSU_EVENT_TOUCH_DOWN:
|
||||
LOG("Down for %s, tracking id %d\n", setsu_device_get_path(event->dev), event->tracking_id);
|
||||
LOG("Down for %s, tracking id %d\n", setsu_device_get_path(event->dev), event->touch.tracking_id);
|
||||
for(size_t i=0; i<TOUCHES_MAX; i++)
|
||||
{
|
||||
if(!touches[i].down)
|
||||
{
|
||||
touches[i].down = true;
|
||||
touches[i].tracking_id = event->tracking_id;
|
||||
touches[i].tracking_id = event->touch.tracking_id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -94,19 +94,19 @@ void event(SetsuEvent *event, void *user)
|
|||
case SETSU_EVENT_TOUCH_POSITION:
|
||||
case SETSU_EVENT_TOUCH_UP:
|
||||
if(event->type == SETSU_EVENT_TOUCH_UP)
|
||||
LOG("Up for %s, tracking id %d\n", setsu_device_get_path(event->dev), event->tracking_id);
|
||||
LOG("Up for %s, tracking id %d\n", setsu_device_get_path(event->dev), event->touch.tracking_id);
|
||||
else
|
||||
LOG("Position for %s, tracking id %d: %u, %u\n", setsu_device_get_path(event->dev),
|
||||
event->tracking_id, (unsigned int)event->x, (unsigned int)event->y);
|
||||
event->touch.tracking_id, (unsigned int)event->touch.x, (unsigned int)event->touch.y);
|
||||
for(size_t i=0; i<TOUCHES_MAX; i++)
|
||||
{
|
||||
if(touches[i].down && touches[i].tracking_id == event->tracking_id)
|
||||
if(touches[i].down && touches[i].tracking_id == event->touch.tracking_id)
|
||||
{
|
||||
switch(event->type)
|
||||
{
|
||||
case SETSU_EVENT_TOUCH_POSITION:
|
||||
touches[i].x = event->x;
|
||||
touches[i].y = event->y;
|
||||
touches[i].x = event->touch.x;
|
||||
touches[i].y = event->touch.y;
|
||||
break;
|
||||
case SETSU_EVENT_TOUCH_UP:
|
||||
touches[i].down = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue