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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Contributor
Jaime_Barrachina
Posts: 21
Registered: ‎10-25-2012
My Carrier: None

Getting keyboard keys as text

Hello, 

is there any way of translating the keyboard codes obtained from keyboard events as text?

 

To be more clear, at some point, once we have a virtual keyboard running, this gets called:

 

screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_KEY_SYM, &key_val);

 

And we get a key_val which is one of the roughly 300 values defined in keycodes.h. If I want to show this as text in a custom label, is there any simple way of converting a key_val or buffer of them into an ansii string?

 

Internally it must be done somehow, as there are default textboxes where the keyboard just "works". 

 

I could always settup a parsing system that converted every key, and put the accents, special symbols, interpreted the shift key, the back key and so on,but it seems a lot of work to go through just to let the player put his name in.

 

Any solutions?

 

Thanks,

Jaime

Please use plain text.