So I’ve created a small app that is designed to be used on smartphones and tablets. Accordingly the app makes use of the sf::Touch class which determines the point on the screen of the device that the finger of the user is touching. This is required because central to the functionality of the app is that it allows the user to swipe across the screen to flick between different images. The end result should be that once a user’s finger (being pressed against the screen) has moved far enough to the left or right periphery of the screen, a swipe function is initiated and the next image moves into view. This appears in the code like so:
if (touchInput.isDown(0))
{
sf::Vector2i currPos;
currPos = touchInput.getPosition(0);
if (currPos.x < 540.0)
{
leftSwipe(currPos);
}
else if (currPos.x > 540.0)
{
rightSwipe(currPos);
}
oldPos = currPos;
}
The problem is that I am testing the application on the PC and when I click the left mouse button down (which I assumed would cause the function touchInput.isDown(0) to return true) it does not appear to update the position of touchInput and was therefore wondering if touchInput should be used on the PC at all and also if it even functions with PC inputs (like a mouse)? or whether for PC testing it would be better to use sf::Mouse instead?