07-10-2010 02:46 AM
Hi All
i have x and y coordinates.
i want to set focus at these coordinates on the main menu screen of my device.
Basically these coordinates reflect the location of one of the menu icons (say "Messages") in the main menu.
i didnt know how to go about it but this is what i have tried so far....
/*
"BBReadFile" is the name of the application. I push it to the background so that i can see menu screen
*/
BBReadFile.getUiApplication().requestBackground();
/*
now i am trying to set focus on one of the menu icons by providing co-ordinate values to the setfocus method
*/
setFocus(139,67,KeypadListener.STATUS_NOT_FROM_KEY
As expected it didnt work....i guess the setfocus() is still focussing on the application and not on the menu screen.
Can someone please guide me with this? i tried googling but didnt get much.....
Thanks,
Saket
07-10-2010 07:02 AM
Hi Saket,
Just wondering if by main menu you mean the main menu of your own application or some other menu?
07-10-2010 07:55 AM
I too am confused by this question. Typically on a Blackberry the menu is obtained by pressing the Blackberry key. The Menu is a popup screen that appears infront of your screen, so there is no need to push the application to the background.
Can you please clarify the question.
07-10-2010 11:53 PM
Hi All
Please allow me to clarify, by menu i am referring to the Blackberry's menu screen. The one you get when u click on the BlackBerry key. The menu has different icons like Messages, Options, Media, Games, Camera etc. You can scroll on these icons using the trackpad/trackball.
I hope i was able to clarify the menu which i want to set focus on. I would like that thru my application i am able to set focus on any of the Blackberry menu icons. As i mentioned earlier i have the x and y coordinates.
I tried the setfocus() method and passed the x and y coordinates but nothing happens? Please let me know what is the correct way of accomplishing this task.
Thanks,
Saket
07-11-2010 03:49 AM
From your application it is not possible to set the focus to a specific location on the default blackberry home screen (what you are referring to here). Once your application goes to the background you no longer have control, and unless you derived a hack by sending to the background, getting the active screen, then manager and then setting the focus im not sure its doable.
07-11-2010 05:39 AM
In BlackBerry terms, the screen you are referring to is more commonly referred to as the Home screen with the Application icons rather than a menu screen with menu items. Menus mean something else entirely.
Like kylefowler, I am not aware of a standard way of achieving what you would like and also suspect that it would extremely difficult to hack this in any way.
07-11-2010 09:47 AM
Okay
But please help me understand this.....
What is happening here:
//BBReadFile is the name of my app. I am pushing it to the background
BBReadFile.getUiApplication().requestBackground();
//What will be the result of the below line?
setFocus(139,67,KeypadListener.STATUS_NOT_FROM_KEY
does it mean that the setfocus() method is working within the scope of my application?
Secondly, i was able to generate a trackball click event which allows me to automatically click on the highlighted app icon on the home screen while my app runs in the background.
Now i just need a way to get the cursor on top of the desired icon before i invoke the click event....
A colleague of mine was able to achieve this on his Windows based handset, surely it must be possible on a BB as well.....i hope. Maybe i will see what logic he is using.......
Thanks,
Saket