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
Highlighted
Developer
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis
Accepted Solution

Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

[ Edited ]

Hi, I was wondering if there is anyway to determine whether a navigation key press will change the screen's focus to another field or not?

 

Thanks in advance.

Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

I do not understand clearly your question but Manager class has getFieldWithFocus() , returning which field have the focus... 

Developer
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

Say for example I have a horizontal field manager with 3 focusable fields. When I press a navigation key, in this case the right or left key, I want to be able to determine whether the field with focus has changed or not. As you know, in this case if we press the right key when the focus is on the third field (the right most field in the manager) the focus won't change to another field.
Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520
My Carrier: Movistar

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

well, also, Field has a isFocus() method that returns true if a the field has the focus. I think you can combine with  getFieldWithFocus() to get what you want...

Developer
Posts: 34
Registered: ‎08-11-2011
My Device: BlackBerry Bold
My Carrier: Axis

Re: Determining Whether A Navigation Key Press Will Change The Screen's Current Focus

I guess I could put the current field with focus inside a variable and compare it with the field that gains focus when I press a navigation key. Thanks for your answer. I'll accept it as a solution.