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
Contributor
razebond
Posts: 30
Registered: ‎06-22-2010
My Device: bold 9700
My Carrier: airtel
Accepted Solution

How to remove Show Keyboard menu?

Hi..,

 

I have designed a screen with device orientation. When the user showing the virtual keayboard, my screen design gets collapsed. There is no editfields in my screen. So I want to remove the "Show Keyboard" menu from the menu list.  I have tried NO_SYSTEM_MENU_ITEMS in the screen. But it removes "Switch application" menu also. I just want to remove the "Show Keyboard" only.. Please help me..

 

 

Thanks...

 

 

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to remove Show Keyboard menu?

[ Edited ]

Hi razebond,

 

For the Virtual Keyboard specifically, you can get a handle on the Screen's designated Virtual Keyboard as outlined in the following document:

http://docs.blackberry.com/en/developers/deliverables/13222/Displaying_touch_screen_keyboard_647781_...

 

From here, you can call VirtualKeyboard.setVisibility(VirtualKeyboard.HIDE_FORCE) to disable the Virtual Keyboard; this will in turn remove the menu item.

 

Alternatively, you could override your Screen's makeMenu() method and use a for loop in conjunction with Menu.getsize() to traverse your Menu's items and look for the item with text Show Keyboard. Once found, you can call Menu.deleteItem(int position) on the location of the Show Keyboard item.

 

This removal would best follow a call to super.makeMenu(Menu menu, int instance) to ensure that the Menu has already been populated.

 

In your case, the recommendation would be to fully disable the Virtual Keyboard as it is a much cleaner approach.

 

Erik Oros

BlackBerry Development Advisor


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
Developer
simon_hain
Posts: 16,001
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How to remove Show Keyboard menu?

removing the menu item with the text is hard to do if you have a localied app @oros.
good to know that the HIDE_FORCE will remove the menu item though.

you can also use the NO_SYSTEM_MENU_ITEMS flag when constructing the mainscreen, but this will also remove other, possibly useful, menu items.

----------------------------------------------------------
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
Please use plain text.
Contributor
razebond
Posts: 30
Registered: ‎06-22-2010
My Device: bold 9700
My Carrier: airtel

Re: How to remove Show Keyboard menu?

[ Edited ]

Thanks oras and simon..

 

I have used HIDE_FORCE. Its working.

 

Thanks again.

Please use plain text.
New Developer
jai1989
Posts: 27
Registered: ‎07-27-2011
My Device: curve
My Carrier: vodafone

Re: How to remove Show Keyboard menu?

aahhh , i am doing all this stuff in my screen's constructor !! and its not doing the desired job ....

 

where i need to write the code ?

 

while overriding the makemenu?

in the construction of the screen?

where ?

 

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 1,557
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to remove Show Keyboard menu?

Hello jai1989,

 

Personally I would recommend taking the code out of the constructor and placing it after your screen has completely finished creation as in the noted sample:

http://docs.blackberry.com/en/developers/deliverables/13222/Displaying_touch_screen_keyboard_647781_...

 

In your case, instead of calling:

 

virtKbd.setVisibility(VirtualKeyboard.SHOW);

You would call:

 

virtKbd.setVisibility(VirtualKeyboard.HIDE_FORCE);

Erik Oros

BlackBerry Development Advisor


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Please use plain text.
New Developer
jai1989
Posts: 27
Registered: ‎07-27-2011
My Device: curve
My Carrier: vodafone

Re: How to remove Show Keyboard menu?

thanks
Please use plain text.