Page 1 of 1

Polling stylus status?

PostPosted: Mar 11, 2006 @ 5:12am
by BradK3
I've noticed an intermittent problem in my current project using PocketFrog.

It seems that every once in a while, my program doesn't call 'StylusUp' immediately after the stylus is raised from the screen. My PocketPC doesn't freeze up at all, it just continues on as if the stylus was still pressed to the screen. After a few seconds, it seems to finally realize the stylus is no longer down and calls 'StylusUp'. Needless to say, the delay is annoying.

I'm not sure if this is a PocketFrog/PocketHAL problem, if it is my (admittedly sloppy) programming or my PocketPC (Dell Axim X30 High).

Has anyone else experienced this?

One solution I have come up with is to poll the state of the stylus on every Display update. You know, ask Windows if it really is pressed down and run 'StylusUp' myself if I have to. Is there a way to do this? I haven't been able to find a function that returns the state of the stylus.

Any ideas?

PostPosted: Mar 12, 2006 @ 12:16pm
by BIGBEN
I've experienced some problems with stylusup/stylusmove.
As I remember in PyroManiA there was a problem that sometimes the stylus move was called just after stylusup, so I used bool styluspressed to check for this.

Have you tried my !PyroManiA! game ? It uses (stylusuptime-stylusdowntime=shorttime) to identify the "click" (not tap, hold and release). If you can't click on the ground and go there in my game - possibly you've got problem with your device - if you can -then there is something in your code ;)

PostPosted: Mar 12, 2006 @ 4:10pm
by fast_rx
I have an x30 high and I know exactly what you're talking about... It can happen with the buttons as well.

You're not limiting the framerate, right? It's like it is too busy to process the events - and it goes away with a small sleep() in the main game loop. Or use one of the framerate limiting techniques already posted.

PostPosted: Mar 14, 2006 @ 5:11pm
by BradK3
BigBen:

I think my problem is a little different than the one you're describing. However, your suggestions may help me with something else I've been struggling with - thanks!

fast_rx:

*Whew*, so I'm not the only one! That's nice to know.

To answer your question: no, I'm not limiting the framerate in anyway. I allow everything to run as fast as possible (I'm getting framerates of around 130 or so), so perhaps that's the problem. I'll check out framerate limiting and see if that solves things for me. Thanks for the tip!