Mouse/stylus Position


MrTAToad

Still Fresh
I've have trouble getting anywhere near accurate stylus positions on a F-200 (and it is calibrated). For instance the left side X position starts at 200+ then goes to 30+ pixels

I'm using the standard SDL (and SDL_MOUSEMOVE and MOUSEBUTTONDOWN).

Any ideas ?
 
I dunno, tho I'm happy its supported by SDL libs right away...

Try using
CODE
SDL_GetMouseState( &mx, &my );

(can be called everywhere) to get the mouse positions, maybe its more accurate...

And btw, you're in the GP32 dev forum.
 
I've just added touchscreen support to my HW SDL libs, it's not brilliantly calibrated but I checked it against gph's and their mouse varies about the same. I'm wondering if the casing is pressing on the edges and offsetting it.

One thing I'd like to know is what the pointer calibration values mean (/etc/pointercal). gph's sdl seems to read it everytime an app starts (and it's written to by the calibration app) but do they make any sense?

GPH talk to us <<hits head against brick wall>>
 
Any chance you could put the compiled lib_SDL.a + header online? My linux install is seriously messed up and dont fancy spending rest of tonight installing the toolchain etc again.

EDIT: I think I got it to compile. How do I initiate the touchscreen in the code? I do not have a f200 so unable to try it myself and relying on others to test builds.
 
The touchscreen code automatically enables itself as a mouse as long as there is no USB mouse detected. It needs tweaking since it only sends mouse movements with the left mouse button down which isn't always desirable.

I'll upload the libSDL.a to my site later tonight when I switch back to linux.
 
Thanks for the info. If this works then you are a god :) My game already fully supports mouse so it should only need a recompile for touchscreen to work. I will keep an eye out for the update. Thanks again!
 
The precompiled libs are up on my site (here).
I'm trying to figure out how the pressure works - the driver returns a slightly varying value for it, but it only varies by about +/- 200 from 45200. The non-static value sort of suggests it can detect pressure difference, but since it's not generating values between 1 and 45000 makes what it does return useless.

EDIT:
I found out that the calibration file is from the linear module of tslib, HWSDL now reads and uses it - and the pointer is nigh on accurate!
 
paeryn said:
I found out that the calibration file is from the linear module of tslib, HWSDL now reads and uses it - and the pointer is nigh on accurate!
Hi,

Paeryn, is that last discover added to last source code on svn? If not, could you explain how to access to calibration data, please?

I would like to add support to touchscreen but outside SDL, using just minilib.

Thanks a lot :)
 
Last edited by a moderator:
Puck2099 said:
Paeryn, is that last discover added to last source code on svn? If not, could you explain how to access to calibration data, please?
Puck2099,

This is the latest DIFF Paeryn committed.
I have given it a spin in ScummVM and the users did suggest it improves accuracy a lot :).

SDL 1.2.9 Touch screen calibration DIFF
 
Last edited by a moderator:
I'd have had the calibration stuff in the first update if I'd only read the thread where Hangman mentioned tslib more carefully - I totally missed the tslib connection and spent several hours working it out myself... I'm hacking in the input smoothing too (I can't get tslib to load the modules properly) so that should help cut down the jittering pointer.
I'm just about to upload the pre-compiled version to my site too (forgot to do it when I submitted the svn.)
 
Back
Top