Page 1 of 1

Key Mappings

PostPosted: Apr 28, 2003 @ 11:07pm
by Presto
I just wrote a key-remapper for Dr. Pocket, but I ran into something funky.

On my Dell Axim, when Button A is pressed, it calls the ButtonDown function twice (using PocketFrog). The first call sends a button value of 91, and the second sends a button value of 193 (which is the unique value). That same 91 is also sent for buttons B, C and Start, in addition to their unique values (194, 195, 196).

And the same behavior exists for the D-Pad. Except instead of sending a button value of 91, it sends 132 in addition to the unique values (37, 38, 39, 40).

So, does anyone else see this behavior? If you didn't understand what I said, ButtonDown is always being called twice with the following values:
Button A - 91 and 193
Button B - 91 and 194
Button C - 91 and 195
Button Start - 91 and 196
D-Pad Left - 132 and 37
D-Pad Up - 132 and 38
D-Pad Right - 132 and 39
D-Pad Down - 132 and 40

I'm curious if this is unique to the Axim, or is it standard across PPCs.

Thanks,
-John

PostPosted: Apr 28, 2003 @ 11:17pm
by Digby

PostPosted: Oct 6, 2003 @ 7:39pm
by efortier
Hi Presto,

I was wondering if you found a solution or an explanation for the double key you get on the PocketPC.

My device is an iPaq 3850 and I'm getting the same thing as you noted in your message back in april, except for the start button which returns 134 followed by 13.

I have taken care of code 132 in my keydown handler, but I don't feel very good about this. Especially since I will have a way for people to remap the keys themselves.

Thanks for any info.

--Eric

PostPosted: Oct 6, 2003 @ 7:41pm
by warmi

PostPosted: Oct 6, 2003 @ 7:46pm
by efortier

PostPosted: Oct 6, 2003 @ 7:56pm
by Presto

PostPosted: Oct 6, 2003 @ 8:03pm
by mlepage

PostPosted: Oct 6, 2003 @ 8:11pm
by efortier

PostPosted: Oct 6, 2003 @ 8:36pm
by mlepage

PostPosted: Oct 6, 2003 @ 9:22pm
by Presto

PostPosted: Oct 6, 2003 @ 10:13pm
by mlepage

PostPosted: Feb 17, 2005 @ 6:29pm
by dan.p

PostPosted: Feb 19, 2005 @ 5:16am
by dan.p
Okay, after a large amount of research I've come across this (special thanks to StephC):

http://www.cewindows.net/developer/pocketpcbuttons.htm

I believe the shadow keys can be filtered out give this information. On each keydown or keyup, test for 0xc1 through 0xc6, and of course the four directions on the d-pad. If the keycode is none of those, simply ignore it. This should solve shadow key issues with all devices.

Also, you'll notice just about every device defaults to 0xc1 through 0xc4 for the 4 buttons (left to right). This should give a good setup for default keys that will please most users out there.

PostPosted: Jul 11, 2005 @ 12:46am
by efortier