diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 2ec29c498cb..777e08e1d00 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -169,6 +169,9 @@ public boolean test(SketchController controller) { /** Command-Option on Mac OS X, Ctrl-Alt on Windows and Linux */ static final int SHORTCUT_ALT_KEY_MASK = ActionEvent.ALT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + /** Command-Option on Mac OS X, Ctrl-Shift on Windows and Linux */ + static final int SHORTCUT_SHIFT_KEY_MASK = ActionEvent.SHIFT_MASK | + Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); /** * true if this file has not yet been given a name by the user @@ -670,7 +673,14 @@ private void buildSketchMenu(JMenu sketchMenu) { item.addActionListener(event -> handleExport(false)); sketchMenu.add(item); - item = newJMenuItemShift(tr("Upload Using Programmer"), 'U'); +// Since CTRL+SHIFT+U is not working on iBus keyboard input method +// Lets redirect the shorcut for Linux to CTRL+ALT+U +// Leaving the preexisting behaviour for Windows & Mac OS + if (OSUtils.isLinux()) { + item = newJMenuItemAlt(tr("Upload Using Programmer"), 'U'); + } else { + item = newJMenuItemShift(tr("Upload Using Programmer"), 'U'); + } item.addActionListener(event -> handleExport(true)); sketchMenu.add(item); @@ -1350,7 +1360,7 @@ static public JMenuItem newJMenuItem(String title, int what) { // Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19) static public JMenuItem newJMenuItemShift(String title, int what) { JMenuItem menuItem = new JMenuItem(title); - menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK)); + menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_SHIFT_KEY_MASK)); return menuItem; }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: