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

Regular Contributor
Posts: 93
Registered: ‎02-03-2011
My Device: Not Specified

detect bb10 phone with physical keyboard?

I am trying to 'future proof' my app as much as possible.  It uses a custom developed keyboard that I have pop-up when needed (long story, but it has fewer keys and hence I wanted a simpler UI).  However, I would be ok if the user used a physical keyboard if the phone had one.  I know there will eventually be a BB10 phone with a physical keyboard, as the documentation says that when released it will have a 720x720 screen.  Does anyone know how one can detect whether there is a physical keyboard or not?  I could try to detect if both stage.fullScreenWidth == 720 && stage.fullScreenHeight == 720, but this feels a bit kludgey.  Thx.

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: detect bb10 phone with physical keyboard?

I would create a function in a class or a static function that you can use to determine this. There will probably be an API for it, but for now, you could simply have a function that is stage.fullScreenWidth == stage.fullScreenHeight.

MyDeviceInfo.hasPhysicalKeyboard() : Boolean

You could easily encapsulate the Device class to leverage existing device info. Most likely, this information will come from that class.
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: detect bb10 phone with physical keyboard?

flash.ui.Keyboard.physicalKeyboardType and flash.ui.Keyboard.hasVirtualKeyboard might help.


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