This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Polling stylus status?


Polling stylus status?

Postby BradK3 » Mar 11, 2006 @ 5:12am

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?
User avatar
BradK3
pm Member
 
Posts: 19
Joined: May 27, 2003 @ 7:34pm
Location: Clearfield, Utah


Postby BIGBEN » Mar 12, 2006 @ 12:16pm

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 ;)
User avatar
BIGBEN
pm Member
 
Posts: 281
Joined: Mar 18, 2003 @ 10:18pm
Location: Saint-Petersburg, Russia


Postby fast_rx » Mar 12, 2006 @ 4:10pm

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.
User avatar
fast_rx
pm Member
 
Posts: 660
Joined: Jun 10, 2003 @ 4:24pm


Postby BradK3 » Mar 14, 2006 @ 5:11pm

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!
User avatar
BradK3
pm Member
 
Posts: 19
Joined: May 27, 2003 @ 7:34pm
Location: Clearfield, Utah


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron