Arrow Keys Problem in Blackberry
Currently i am working on开发者_如何学JAVA Blackberry Application and stuck at this point that how to access Right and Left Arrow Keys for generating events against these. I will be very Thankful to you.
class LocationMain extends UiApplication {
public LocationMain()
{
pushScreen(new LocTestScreen());
}
public static void main(String args[])
{
LocationMain app = new LocationMain();
app.enterEventDispatcher();
}
}
class LocTestScreen extends MainScreen {
protected boolean navigationMovement(int dx, int dy, int status, int time) {
if(dy < 0)
System.out.println("UP");
if(dy > 0)
System.out.println("down");
if(dx < 0)
System.out.println("left");
if(dx > 0)
System.out.println("right");
return false;
}
}
精彩评论