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

Java Development

Reply
New Contributor
Posts: 3
Registered: ‎10-07-2011
My Device: developer
My Carrier: developer

How to support QWERTY and AZERTY keyboards in same application.

In my application we have different key response for both Q and A, which needs to work on both keyboard layout (QWERTY and AZERTY). I got the test result that OS wont take care of this automatically. So I need to check the layout and swap the keys accordingly. I tried to use getHardwareLayout() method, but not much progress with the same. Can you confirm that RIM has any other method to tackle this?

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to support QWERTY and AZERTY keyboards in same application.

welcome to the support forums.

what exactly do you want to achieve?
keyChar usually gets you the character that was pressed.
you can also use getAltedChar and getUnaltedChar to check for numbers.

Other than that there is very little support for different hardware layouts, and there are a lot more than only qwerty and azerty, especially when you count in the limited keyboards, like on a style or pearl.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 3
Registered: ‎10-07-2011
My Device: developer
My Carrier: developer

Re: How to support QWERTY and AZERTY keyboards in same application.

Thanks for the reply, but those wont give solution for my purpose.

I have 2 different type of functionalty assigned to "Q" and "A" in my application.

QWERTY - Suppose I have given functionality of "Left soft key" for "Q" and "A" has to perform some other action like "Fire".

AZERTY (or any other layout) - Now I need to swap both the keys, because "A" came in the place of "Q" and vice versa. Here I need to check the layout or type of keyboard then only I can swap the functionality of the key accordingly. I need to have "Left Soft Key" functionality for "A" and "Q" should have the functionality of "FIRE".

How can I achieve this?

 

Trusted Contributor
Posts: 151
Registered: ‎06-17-2010
My Device: Curve 8900
My Carrier: Vodafone

Re: How to support QWERTY and AZERTY keyboards in same application.

[ Edited ]

hi dronaus,

 

Here i have made a generic code to find out the KeYpad style. 

 

You can use this code with small modification to know which type of keyboard in your device.

Use this code. Take a Global variable _QUERTY and _AZERTY for use in application.

 

And when ever you call Keychar method in your application check boolean _QUERTY and _AZERTY.

and code your keychar method according to Keypad. 

 

Hope You all are Smiley Happy

 

private static boolean keyboardCheck(){
    	boolean _QUERTY = false;
    	boolean _AZERTY = false;
    	
    	char altcharQ =  Keypad.getUnaltedChar(Characters.NUMBER_SIGN);
    	char altcharW =  Keypad.getUnaltedChar(Characters.DIGIT_ONE);
    	char altcharE =  Keypad.getUnaltedChar(Characters.DIGIT_TWO);
    	char altcharR =  Keypad.getUnaltedChar(Characters.DIGIT_THREE);
    	char altcharT =  Keypad.getUnaltedChar(Characters.LEFT_PARENTHESIS);
    	char altcharY =  Keypad.getUnaltedChar(Characters.RIGHT_PARENTHESIS);
    	
    	if(altcharQ == 'Q'&& altcharW == 'W'&& altcharE == 'E'&& altcharR == 'R'&& altcharT == 'T'&& altcharY == 'Y'){
    		return _QUERTY = true;
    	}else if(altcharQ == 'A'&& altcharW == 'Z'&& altcharE == 'E'&& altcharR == 'R'&& altcharT == 'T'&& altcharY == 'Y'){
    		return _AZERTY = true;
    	}else{
    		return ANOTHERKEYBOARD;
    	}
    }

--------------------------------------------------------------------

Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you.

 

Highlighted
New Contributor
Posts: 3
Registered: ‎10-07-2011
My Device: developer
My Carrier: developer

Re: How to support QWERTY and AZERTY keyboards in same application.

Hi Albert_Anks,
This seems good solution, thanks for your reply and solution. Really appreciated.