Need help. It happens when I use Nutiteq for Blackberry.
I use UserDefinedKeysMapping to user 'A', 'W', 'D', and 'S' as map controller. But I'm facing this condition. When I press 'O', the map will zoom out once (I mean one level) and then stops. But when I press 'S', it keep moving up and I unable to stop it.
Here is my code:
keysMapping.defineKey(ControlKeys.ZOOM_OUT_KEY, 79); // 79 is ascii for O
keysMapping.defineKey(ControlKeys.ZOOM_IN_KEY, 73); // 73 is ascii for I
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 86);
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 83);
keysMapping.defineKey(ControlKeys.MOVE_LEFT_KEY, 65);
keysMapping.defineKey(ControlKeys.MOVE_RIGHT_KEY, 68);
Am I do something wrong? What is the solution?
Without this keys mapping, everything goes well with my trackpad.
Regards,
Amri
It seems that your library does not get keyReleased events to stop panning.
a) check if you have following in your code:
protected boolean keyUp(final int keyCode,
final int time) {
mapComponent.keyReleased(Keypad.key(keyCode));
return true;
}
b) try different panning strategies
1) thread-driven, default:
mapComponent.setPanningStrategy(new ThreadDrivenPanning());
2) event-driven:
mapComponent.setPanningStrategy(new EventDrivenPanning());
Yes, it solved JaakL. Thanks a lot.
Sorry, I think I make mistake here:
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 86);
keysMapping.defineKey(ControlKeys.MOVE_UP_KEY, 83);
Solved.