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
Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

keydown and menu event issue

hello pals

i have a problem about use this event together if i use a key down event this disable the menu event so any have any aidea about it

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: keydown and menu event issue

[ Edited ]

Please only ask your questions once.  Your question is answered here:

http://supportforums.blackberry.com/t5/Java-Development/keycode-for-trackpad-button/m-p/1654201#M195...

 

Edit:

Apologies, I misread the question.

Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

Re: keydown and menu event issue

that is different cause here i try to manage the bb key event and key down event in the other post i talk about the keydown event and the click event of trackpad

Highlighted
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: keydown and menu event issue

I cannot answer exactly without seeing the code of your keyDown override. I can make a guess, however: most probably your keyDown method returns true where it shouldn't. If you do not process an event yourself, returning super.keyDown is the safest way of handling it.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

Re: keydown and menu event issue

well i change the return by false but now i have another problem because the event keydown is about the return key and first when i press this key i see how this change of line in my listfield there any way for just execute the event before its change the line

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: keydown and menu event issue

If you want the 'enter' key to process as a click, have you tried overriding keyChar for the ListField. 

Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

Re: keydown and menu event issue

i override keychar

public boolean keyChar( char key, int status, int time )
    {
        if ( key == Characters.ENTER )
        {
            System.out.println("here");


......

           }
        }
        
        return false;
    }

 

 

but it doesn't work when i press enter key it's change of line and later change my screen

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: keydown and menu event issue

If you only need to process ENTER key, do not override keyDown, do everything in keyChar. keyDown is a lower-level call which you should override only when you really need it and know exactly what you are doing. Overriding such stuff in games where timing is crucial can be necessary; in regular applications it will do you more harm than good.

 

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Trusted Contributor
Posts: 121
Registered: ‎01-19-2011
My Device: Not Specified
My Carrier: engineer

Re: keydown and menu event issue

thats i do now but the issue continue, i have a listfield when i selected one and click enter open a new Screen but first this jump to next line before to change screen, there a way for this not happen i just want to see new Screen not the change of line

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: keydown and menu event issue

On what level are you overriding keyChar? Is in in your Screen or the ListField? MainScreen, I believe, has its own processing of ENTER key, so you might want to override it there.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!