From e6a69d29bd654d8995efb9c15a3cdd92e501438f Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Sat, 15 Jun 2013 12:00:17 -0500 Subject: [PATCH] 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 --- tools/cooja/java/se/sics/cooja/plugins/TimeLine.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java index d1349d1b9..730af29d7 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java @@ -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);*/