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

Adobe AIR Development

Reply
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

BB10 - Checking for physical keyboard

I'm trying to use ThemeGlobals.keyboardShortcutsEnabled to check if my app is running on a device with physical keyboard or not - but FlashBuilder doesn't seem to recognize this property, so it won't compile (I'm using the 3.1.1 SDK and other properties of  ThemeGlobals, like currentTheme for example, work fine).

 

I guess I can just check screen measurements to see if the app is running on a Q10, but it would seem more professional (?) and future-proof to actually test for a physical keyboard, rather than assuming that a square screen would have one and a rectangular screen must be full-touch ...

 

Can anyone help me with the proper way to test for physical keyboard or any ideas why FlashBuilder can't find keyboardShortcutsEnabled ?

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: BB10 - Checking for physical keyboard

The AIR runtime already has functions for this:

 

Flash.ui.Keyboard.hasVirtualKeyboard

Flash.ui.Keyboard.physicalKeyboardType

 

Assuming BB did a good job on the AIR runtime port, these properties should reflect the capabilities of the current device.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10 - Checking for physical keyboard

[ Edited ]

Thanks Jon,  I didn't think of those!  But actually, it looks like they didn't do such a good job ... Both my LE device and the Q10 simulator return

 

Keyboard.hasVirtualKeyboard: true
Keyboard.physicalKeyboardType: alphanumeric

 

(that's back on the 3.0.0 SKD though  -  I couldn't get 3.1.1 to work at all )

 

[ Edit:  it still holds for 3.1.1 too. ]

 

Anna

 


My app : Get set - Get up!   Get ready for the snooze revolution.

 

Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: BB10 - Checking for physical keyboard

Best to file a bug in https://www.blackberry.com/jira

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10 - Checking for physical keyboard

done ( https://www.blackberry.com/jira/browse/BBTEN-1099 )

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.
BlackBerry Development Advisor (Retired)
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: BB10 - Checking for physical keyboard

Not sure what Keyboard.physicalKeyboardType is actually getting. I escalated to the AIR SDK team.

 

Cheers,
Dustin

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10 - Checking for physical keyboard

Thanks Dustin!  Do you happen to know anything about the qnx one: ThemeGlobals.keyboardShortcutsEnabled ?

(It's in the docs, but when I look at ThemGlobals with the FB package explorer I don't see that property)

 

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.
BlackBerry Development Advisor (Retired)
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: BB10 - Checking for physical keyboard

Hmm - My guess is that it's depracated but the docs have not been updated. I'll let the docs guys know!

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
BlackBerry Development Advisor (Retired)
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: BB10 - Checking for physical keyboard

Anna - are you using the latest version of the SDK? 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10 - Checking for physical keyboard

Yes, 3.1.1  ... just switched yesterday

Please use plain text.