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
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to move focus left/right/up/down

http://www.blackberry.com/developers/docs/4.2.1api/net/rim/device/api/ui/Screen.html#navigationMovem...(int, int, int, int)

what methods require you to return false to indicate that they consumed the event?
----------------------------------------------------------
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
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to move focus left/right/up/down

keyDown(), keyRepeat(), etc.

 

 

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

Re: How to move focus left/right/up/down

http://www.blackberry.com/developers/docs/4.2.1api/net/rim/device/api/ui/Screen.html#keyDown(int, int)

Returns:
True if event was consumed; otherwise, false.

maybe you have a custom API? Smiley Happy

don't want to bother you with it, i was just interested in inconsistencies in the API, but right now everything looks fine.
----------------------------------------------------------
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
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to move focus left/right/up/down

Ok, clearly I've been working to many hours.  I'm seeing things now.  =)  Either that or RIM did the fastest fix ever!

 

I think it must be my clue it's time to sleep rather than program.

 

Highlighted
Developer
Posts: 157
Registered: ‎05-10-2009
My Device: Not Specified

Re: How to move focus left/right/up/down

Kudos 

protected boolean navigationMovement( int dx, int dy, int status, int time ) 
	{
		final int RIGHT = 0;
		final int LEFT  = 1;
		final int UP    = 2;
		final int DOWN  = 3;
		int direction = -1;
				
        
       
        if( Math.abs( dx ) > Math.abs( dy ) ) 
        {
            if( dx > 0 ) 
            {
            	direction = RIGHT;
            } 
            else 
            {
            	direction = LEFT;
            }
        } 
        else 
        {
            if( dy > 0 ) 
            {
            	direction = DOWN;
            } else 
            {
            	direction = UP;
            }
        }
Contributor
Posts: 20
Registered: ‎03-04-2011
My Device: 9800
My Carrier: application developer

how to move fousable button

hello 

i have created a button as focusable but now i need to move that button on the middle of the screen how to do that please help me on that ....

 

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

Re: how to move fousable button

Don't think positioning a button is related to the previous comments on the Thread that were all about moving focus.  I suggest you start a new Thread for a new question.  But before doing that, I suggest you review this:

 

http://supportforums.blackberry.com/t5/Java-Development/Create-a-custom-layout-manager-for-a-screen/...

 

 

Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: How to move focus left/right/up/down

So from this code, how do finally set the focus to the desired field
_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.