Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 15fc84e

Browse filesBrowse files
committed
Ctrl-shift-U does not work work when editor is focused arduino#9895
1 parent a1e43ce commit 15fc84e
Copy full SHA for 15fc84e

File tree

Expand file treeCollapse file tree

1 file changed

+20
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+20
-4
lines changed

‎app/src/processing/app/Editor.java

Copy file name to clipboardExpand all lines: app/src/processing/app/Editor.java
+20-4Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ public boolean test(SketchController controller) {
169169
/** Command-Option on Mac OS X, Ctrl-Alt on Windows and Linux */
170170
static final int SHORTCUT_ALT_KEY_MASK = ActionEvent.ALT_MASK |
171171
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();
172175

173176
/**
174177
* true if this file has not yet been given a name by the user
@@ -670,9 +673,22 @@ private void buildSketchMenu(JMenu sketchMenu) {
670673
item.addActionListener(event -> handleExport(false));
671674
sketchMenu.add(item);
672675

673-
item = newJMenuItemShift(tr("Upload Using Programmer"), 'U');
674-
item.addActionListener(event -> handleExport(true));
675-
sketchMenu.add(item);
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+
{
682+
item = newJMenuItemAlt(tr("Upload Using Programmer"), 'U');
683+
item.addActionListener(event -> handleExport(true));
684+
sketchMenu.add(item);
685+
}
686+
else
687+
{
688+
item = newJMenuItemShift(tr("Upload Using Programmer"), 'U');
689+
item.addActionListener(event -> handleExport(true));
690+
sketchMenu.add(item);
691+
}
676692

677693
item = newJMenuItemAlt(tr("Export compiled Binary"), 'S');
678694
item.addActionListener(event -> {
@@ -1350,7 +1366,7 @@ static public JMenuItem newJMenuItem(String title, int what) {
13501366
// Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
13511367
static public JMenuItem newJMenuItemShift(String title, int what) {
13521368
JMenuItem menuItem = new JMenuItem(title);
1353-
menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK));
1369+
menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_SHIFT_KEY_MASK));
13541370
return menuItem;
13551371
}
13561372

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.