diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 28db19273..4eef5614c 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1397,12 +1397,15 @@ public class Editor extends JFrame implements RunnerListener { JMenuItem increaseFontSizeItem = newJMenuItem(tr("Increase Font Size"), KeyEvent.VK_PLUS); increaseFontSizeItem.addActionListener(event -> base.handleFontSizeChange(1)); menu.add(increaseFontSizeItem); - - JMenuItem decreaseFontSizeItem = newJMenuItem(tr("Decrease Font Size"), '-'); - decreaseFontSizeItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - base.handleFontSizeChange(-1); - } + // Add alternative shortcut "CTRL SHIFT =" for keyboards that haven't the "+" key + // in the base layer. This workaround covers all the keyboards that have the "+" + // key available as "SHIFT =" that seems to be very common. + KeyStroke ctrlShiftEq = KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK); + menu.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ctrlShiftEq, "IncreaseFontSize"); + menu.getActionMap().put("IncreaseFontSize", new AbstractAction() { + public void actionPerformed(ActionEvent e) { + base.handleFontSizeChange(1); + } }); menu.add(decreaseFontSizeItem);