Compensation for single touch input in SDL?
Okay first things first, I have a tablet with a touch screen that only has single touch input. Right now my main programming library is SDL, and I was testing a game I was working on for Windows on another computer, in Ubuntu Linux. One of things I noticed was that the touch screen of this computer was showing up as a joystick, and so I thought, cool, I can program in touch screen input. One obstacle is that I don't understand how to do that with SDL, the second obstacle is that my touch screen is only single touch input. Is there any math algorithm\equation I could use to compensate to work with multi-touch input? I know that when I use the touch screen (in Windows right now) and I put two fingers apart from each other, the cursor will move to the centre between the two points. Is there any possible way to compensate for this?
I would imagine (but this is pure speculation on my part), that SDL models the touchscreen as a joystick, with x and y axes equating to the x and y axes of the screen.
However, since I doubt it is documented anywhere, your best bet is to either dg around in the source code of the SDL port for that platform to find out exactly what it is doing, or failing that, to build a small test application that logs all joystick input, and see if you can decode what data it is sending you...
However, since I doubt it is documented anywhere, your best bet is to either dg around in the source code of the SDL port for that platform to find out exactly what it is doing, or failing that, to build a small test application that logs all joystick input, and see if you can decode what data it is sending you...
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement