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
Developer
sblantipodi
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.

 

 

Please use plain text.
Developer
acowart
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
Please use plain text.
Developer
sblantipodi
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.

Please use plain text.
Developer
sblantipodi
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.-_-

 

Please use plain text.
Developer
sblantipodi
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.

 

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

no idea?
Please use plain text.
Developer
sblantipodi
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) {
       
    }

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

have you finished your idea?
Please use plain text.
Developer
sblantipodi
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...

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009
My Device: Not Specified

Re: BlackBerry softkeys.

bump!
Please use plain text.