Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
JimmyLord
Posts: 17
Registered: ‎07-12-2012
My Device: BB10 Alpha Device
My Carrier: none

Keyboard events Q10

[ Edited ]

Hi,

 

I started playing with a dev alpha C today and decided to immediately try to use the keyboard as buttons.  The keyboard flags in keycodes.h seem limited with only KEY_DOWN, KEY_REPEAT(which didn't fire for me, barely checked), and a few others, but no KEY_UP.

 

I dropped a breakpoint in code and releasing a key always gave me either:

int 224  <-> binary 1110 0000

or

int 736 <-> binary 10 1110 0000

depending on the key.

 

Essentially bits 6, 7, and 8 are always set on release.  I can easily write the functionality I need based on this behaviour, but since it's not in the header, I'm hesitating.

 

So, I guess I have a few questions.

Am I using the right header?

Is there an official way to get a "KEY_UP" event?

Is there any way to poll for key states?  I'd prefer this as I can avoid coding around things like Hold key -> Swipe up to minimize app -> Release key with no release message ever arriving.

 

Thanks,

Jimmy

 

EDIT:

just did the math and noticed those 3 bits are:

KEY_SCAN_VALID, KEY_SYM_VALID and KEY_CAP_VALID

 

I guess that works as a "documented" key_up, I'll use them for now I guess, the 10th bit on certain keys is still a mystery.

Please use plain text.