cooja TimeLine: zoom keystroke failure

The + typed character can only be generated on English keyboards by
shift-equals, resulting in a failure to recognize ctrl-plus because of
the unexpected shift modifier.  Adapt by supporting English and Spanish
keyboards, as well as number pad keys.

Closes pabigot/contikix#2

Reference: http://forums.oracle.com/thread/1356291
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2013-06-15 12:00:17 -05:00
parent 0c373a8bee
commit e6a69d29bd

View file

@ -358,8 +358,11 @@ public class TimeLine extends VisPlugin implements HasQuickHelp {
/* Zoom in/out via keyboard*/
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, KeyEvent.CTRL_DOWN_MASK), "zoomIn");
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, KeyEvent.SHIFT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK), "zoomIn");
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, KeyEvent.CTRL_DOWN_MASK), "zoomIn");
getActionMap().put("zoomIn", zoomInAction);
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, KeyEvent.CTRL_DOWN_MASK), "zoomOut");
getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, KeyEvent.CTRL_DOWN_MASK), "zoomOut");
getActionMap().put("zoomOut", zoomOutAction);
/* getContentPane().add(splitPane);*/