PocketMatrix forums

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

Stylus down/up events

Hey ppl, I've got another odd problem with stylus events in GapiDraw 3.5b3.

For a normal tap on the screen, I'd expect to get a StylusDown event followed by StylusUp with the possibility of StylusMove's inbetween. That happens as expected, however, after the StylusUp event is received _another_ StylusDown event is always received.

The coordinate the 2nd Down event comes with is sometimes very close to the point where the StylusUp event was received, but not always. Sometimes it'll be off by as much as 20 to 50 pixels -- clearly not an accidental click.

Even if it was, the 2nd Down event is never followed by an Up event.. Needless to say, this interferes with my UI code pretty bad hehe... Is there a reason this happens and a way to stop it?

Thanks
What device are you seeing this happen on?
It's a Toshiba e805
If you can put together a simple example of the problem, I can test it on some other devices. Are you running under WM2003 or WM2003SE?
InexorableTash · 29 Oct 2004, 03:39 UTC
Also, are you positive that you're getting a real WM_MOUSEDOWN event from the system? Brave debugging on the actual device and stuff a breakpoint your handler and check the entire stack back up to the message pump and beyond - it's possible there's a bug in your code or GapiApplication that's falling through into your code unintentionally. (It could even be something as strange as dereferencing a bad pointer and branching into your handler and somehow not crashing.)

Hopefully that's the case, otherwise something really freaky is going on and it'll be harder to fix.
Well, you will always get a stylus down assuming your next 'next state' is excuted after you leave your previous state right?

Do your change state 'only' on Stylus Up ;-) This will solve your issue.

Hope i get your problem right hehe. Goodluck.
Sorry about the delay, I've been sick.

My Toshiba runs WM2003SE.

I haven't altered the message loop and I don't handle WM_ events myself. I just use the overloaded StylusDown/Up functions of CGapiApplication, which behaves as I described. The coordinate in the POINT structure passed to those functions contains a location I may never have clicked, which is extra strange.

I'll put together a test app using one of the SDK samples. Hopefully the problem is reproducable hehehe... Otherwise, it must be something I did... but considering what I've done, it doesn't seem likely.

As for UI element states, Down events mark an element as down, and an Up event clears the down state of all elements. That's why this extra Down event is making my buttons stick.

Anyway, I'll get back with you guys when I have the sample app to post.