@@ -169,6 +169,9 @@ public boolean test(SketchController controller) {
169
169
/** Command-Option on Mac OS X, Ctrl-Alt on Windows and Linux */
170
170
static final int SHORTCUT_ALT_KEY_MASK = ActionEvent .ALT_MASK |
171
171
Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask ();
172
+ /** Command-Option on Mac OS X, Ctrl-Shift on Windows and Linux */
173
+ static final int SHORTCUT_SHIFT_KEY_MASK = ActionEvent .SHIFT_MASK |
174
+ Toolkit .getDefaultToolkit ().getMenuShortcutKeyMask ();
172
175
173
176
/**
174
177
* true if this file has not yet been given a name by the user
@@ -670,7 +673,15 @@ private void buildSketchMenu(JMenu sketchMenu) {
670
673
item .addActionListener (event -> handleExport (false ));
671
674
sketchMenu .add (item );
672
675
673
- item = newJMenuItemShift (tr ("Upload Using Programmer" ), 'U' );
676
+ // Since CTRL+SHIFT+U is not working on iBus keyboard input method
677
+ // Lets redirect the shorcut for Linux to CTRL+ALT+U
678
+ // Leaving the preexisting behaviour for Windows & Mac OS
679
+ String OS = System .getProperty ("os.name" ).toLowerCase ();
680
+ if (OS .indexOf ("nix" ) >= 0 || OS .indexOf ("nux" ) >= 0 || OS .indexOf ("aix" ) >= 0 ){
681
+ item = newJMenuItemAlt (tr ("Upload Using Programmer" ), 'U' );
682
+ } else {
683
+ item = newJMenuItemShift (tr ("Upload Using Programmer" ), 'U' );
684
+ }
674
685
item .addActionListener (event -> handleExport (true ));
675
686
sketchMenu .add (item );
676
687
@@ -1350,7 +1361,7 @@ static public JMenuItem newJMenuItem(String title, int what) {
1350
1361
// Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
1351
1362
static public JMenuItem newJMenuItemShift (String title , int what ) {
1352
1363
JMenuItem menuItem = new JMenuItem (title );
1353
- menuItem .setAccelerator (KeyStroke .getKeyStroke (what , SHORTCUT_KEY_MASK | ActionEvent . SHIFT_MASK ));
1364
+ menuItem .setAccelerator (KeyStroke .getKeyStroke (what , SHORTCUT_SHIFT_KEY_MASK ));
1354
1365
return menuItem ;
1355
1366
}
1356
1367
0 commit comments