Skip to content

Commit

Permalink
Merge pull request #24 from fiskn/master
Browse files Browse the repository at this point in the history
Add standard X & Y events for EV_ABS
  • Loading branch information
mickelson authored Jan 3, 2021
2 parents ac2c264 + 79166e4 commit 754ed8f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/SFML/Window/Unix/DRM/InputImplUDev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,18 @@ namespace
}
else if ( ie.type == EV_ABS )
{
bool posChange = false;
switch ( ie.code )
{
case ABS_X:
mousePos.x = ie.value;
posChange = true;
break;

case ABS_Y:
mousePos.y = ie.value;
posChange = true;
break;
case ABS_MT_SLOT:
currentSlot = ie.value;
touchFd = *itr;
Expand All @@ -488,6 +498,13 @@ namespace
touchFd = *itr;
break;
}
if ( posChange )
{
ev.type = sf::Event::MouseMoved;
ev.mouseMove.x = mousePos.x;
ev.mouseMove.y = mousePos.y;
return true;
}
}
else if ( ie.type == EV_SYN && ie.code == SYN_REPORT &&
*itr == touchFd)
Expand Down

0 comments on commit 754ed8f

Please sign in to comment.