PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

StylusMove problems

golan_trevize_x · 14 Dec 2003, 22:56 UTC
Hey all,

I know this is a topic that has numerous posts in the past, but my problem seems a little different.

In order to provide an alternative to the dodgy d-pad on my pocket pc, I am implementing a "directional disc" control, where the user holds the stylus inside a visible circle on the screen and moves it around. This means that the stylus is held down continuously for some time.

Anyway, I can observe the usual drop in performance when the stylus is held down, but my bigger problem is that frequently the stylus input events will just stop happening for a couple of seconds. During that period, the stylus can be moved around or lifted off the screen, and no events will occur. Is something being overloaded?

I'd appreciate any help,

Nathan
First, be sure that you're not simply stalling in part of your program. If you're using the single threaded application framework, its not too hard to lose stylus events - especially if you're doing alot of AI processing. You may also want to look into using the multi-threaded framework because the stylus events will be much more responsive.
golan_trevize_x · 15 Dec 2003, 00:16 UTC
Yeah, the program is not stalling - I have animation that continues to run during this "dead period" of stylus input, so the ProcessNextFrame event is still working properly.

I haven't looked into the multi-threaded framework yet - I've been too scared of all the memory problems that can happen with a multi-threaded app - but I may have to give it a try.

Is there any documentation on how I might begin?

Thanks,
Nathan
What device are you testing this on, and does it work correctly on the desktop? If you're not stalling out during processing and missing events you're probably not generating the events you think you are. Remember that during stylus movement, you don't get stylus down events (a common mistake).

Using the MT framework can be a bit tricky if your application isn't designed from the beginning to be multithreaded. I typically use game states to track what is supposed to be happening at any particular time. This make MT alot easier to work with.

I've not had any memory issues using the MT framework, and it was used for both pocketPachisi (AI intensive) and 5 Card Spin (user I/O and graphics intensive). Warlords II and Rail Mania use the single threaded model.

Still, the only time I've noticed any stylus 'lag' was using the single threaded framework and accidentally stalling the processing loop out.
golan_trevize_x · 15 Dec 2003, 02:20 UTC
Thanks for your help here dude,

The device is the Toshiba e740 :roll:, yeah I know, I'm seriously ruing the purchase now, but it was the most exciting PPC to go for at the time.

I haven't tested on the desktop yet because I haven't bought VC++. But that would be a good idea to test that.

I am using the StylusMove event to record the current position, but the processing for this control I made is only done once per frame, and only happens if we know the stylus is down. The problem is that the StylusMove event, along with the other two, just doesn't happen for a couple of seconds.

The way this is happening, it really strikes me like it wouldn't happen on the desktop. It seems like some kind of performance bottleneck or something. Like when your desktop PC sometimes stops listening to the keyboard and churns away for a while.

The thing is, I'm pretty sure I'm well over the target frame rate, so it's not dropping below ever.

Nathan
If you haven't tried already, load the Simple demo that comes with GD to see if the problem is inherent with your device. There is always the possibility that your hardware has problems (remote possibility).

Are you running anything in the background that might be sucking up the events? I presume you've tried debugging directly on the device. If not, you might try that to see if the inherent delays in the debugger free up the message pump. That may lead you to a solution if it does.

I think Johan was using the e7xx device for GD testing at one time. I'm sure if there was a problem with the stylus move events he would have seen it during testing.
golan_trevize_x · 15 Dec 2003, 10:12 UTC
OK, well I just turned on my PPC again and it's not happening. I think it just needed a reset! :roll:

Sorry about that!!
golan_trevize_x · 15 Dec 2003, 22:09 UTC
Just a final update on this issue - I've determined that the problem still occurs if I run my game while the PPC is connected to my computer with ActiveSync (I use the e740's built-in WiFi for this).

However, once the PPC is on its own, things are a lot better, although it still happens very rarely.

Nathan
why dont you release a demo for testing if others hit same problem ;-)
Some WiFi implementations can stall the ppc out if they lose connection. It seems they go into a polling mode while they try to reconnect. You might check if there is a system setting to lessen the effect.