目前我正在开发黑莓应用程序,并且在这一点上坚持如何访问右箭头键和左箭头键来生成针对这些的事件。我会非常感谢你。
答案 0 :(得分:1)
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;
}
}