Skip to content

Commit 49242be

Browse files
Pieter12345cmaglie
authored andcommitted
Add editor zoom "CTRL =" shortcut
Add "CTRL =" as additional shortcut to increase the editor font size. This shortcut should be added because the '+' and '=' characters are often on the same key on the keyboard and having to press SHIFT as well is not intuitive for all users (especially since many common applications support "CTRL =").
1 parent f119590 commit 49242be

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/processing/app/Editor.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1270,12 +1270,14 @@ private JMenu buildEditMenu() {
12701270
JMenuItem increaseFontSizeItem = newJMenuItem(tr("Increase Font Size"), KeyEvent.VK_PLUS);
12711271
increaseFontSizeItem.addActionListener(event -> base.handleFontSizeChange(1));
12721272
menu.add(increaseFontSizeItem);
1273-
// Add alternative shortcut "CTRL SHIFT =" for keyboards that haven't the "+" key
1274-
// in the base layer. This workaround covers all the keyboards that have the "+"
1275-
// key available as "SHIFT =" that seems to be very common.
1273+
// Many keyboards have '+' and '=' on the same key. Allowing "CTRL +",
1274+
// "CTRL SHIFT +" and "CTRL =" covers the generally expected behavior.
12761275
KeyStroke ctrlShiftEq = KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK);
12771276
menu.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ctrlShiftEq, "IncreaseFontSize");
1277+
KeyStroke ctrlEq = KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, SHORTCUT_KEY_MASK);
1278+
menu.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ctrlEq, "IncreaseFontSize");
12781279
menu.getActionMap().put("IncreaseFontSize", new AbstractAction() {
1280+
@Override
12791281
public void actionPerformed(ActionEvent e) {
12801282
base.handleFontSizeChange(1);
12811283
}

0 commit comments

Comments
 (0)