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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

Yes I'm using canvas...

I took that using RIM compiler we can use keyDown also for canvas since all of you

told me to use it -_-

 

Ok, it doesn't works also on keyPress.

 

 

Developer
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: BlackBerry softkeys.

Use

protected void keyPressed(int keyCode){
System.out.println("Keycode is " + keyCode);
}

Add that to your canvas.  Open the console with the simulator, and then push a few keys - their key codes should show up.  Then push the menu button, and you should have the key code for that.

 

If the other keys print their keycode, but the menu button does not, it may not be possible to capture that on a canvas.

Andrew Cowart | Metova
www.metova.com
Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

this is what I'm trying to explain from first post, I'm sorry...

I can't capture keypressed for that button...

 

When I press MENU button no keycode is printed.

Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

Ok, I have implemented CommandListener but it doesn't trap the menu press.-_-

 

Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

Using CommandListener I can trap when menu button is pressed, but to trap it I need to add at least one command to my canvas using addCommand(cmd);

 

Doing this results in a blackberry like menu with my command appened.

I don't want this. I want to display directly my personalized menu, something like that.

 

Is it possible to display directly my personalized menu after the pression on MENU button also by using CommandListener?
If yes, how can I do that?
In the way posted before seems that it is not possible because it draws a BB menu before drawing my personalized one.

 

Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

no idea?
Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

this is the code I'm using to override makeMenu

 

//#if BlackBerry_JDE_4_7 || BlackBerry_JDE_4_7_0
    protected boolean keyDown(int keycode, int time) {
        if (Keypad.key(keycode) == Keypad.KEY_MENU) {
            open = true;
            repaint();
            return true;
        } else {
            return false;
        }
    }

    void makeMenu(Menu menu, int instance) {
       
    }

Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

have you finished your idea?
Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

Is it possible to override the default menu with a personalized one when pressing MENU button?

I haven't find any answer that can confirm that, so I don't want to waste other time finding a solution if there is no solutio...

Developer
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

bump!