07-13-2010 01:48 AM
Hi,
I have created an image button and it recognizes mouse click in touch Simulotor. But, when the focus is on the button, when i press ENTER, it doesn't recognize. I have to create the button for non touch handsets. Is there any solution? My code is like this
Bitmap bitmap1 = Bitmap.getBitmapResource("Add.png");
btField1 = new BitmapField(bitmap1, BitmapField.FOCUSABLE | DrawStyle.HCENTER)
{
protected boolean navigationClick(int status, int click)
{
fieldChangeNotify(1);
return true;
}
};
Any help will be highly appreciated
Solved! Go to Solution.
07-13-2010 03:33 AM
overwrite keychar to process the keys you want to handle
07-13-2010 04:06 AM
I have meet this question before, but I am not using bitmapField to carry the handle functions.
( I put them in the MainScreen, using a variable "status" to record the user status ).
So I dont know if it can be done in your bitmapField.
Owing the blackberry use its wheel ball's push to push "enter", so I add this function handle the wheel ball's pushing:
protected boolean trackwheelClick(int status, int time) {
// code for push enter
return true;
}
And I think someone maybe push "Enter" (at least I push enter in simulator), so I add this function to handle "enter" button:
protected boolean keyChar(char c, int status, int time){
if ( c==Characters.ENTER ){
//code for push enter
}
return super.keyChar(c,status,time);
}
Maybe you can try it in your bitmapField. Good Luck for you!