mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
Ctrl-shift-U does not work work when editor is focused #9895
This commit is contained in:
parent
a1e43ce490
commit
15fc84e021
@ -169,6 +169,9 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
/** Command-Option on Mac OS X, Ctrl-Alt on Windows and Linux */
|
/** Command-Option on Mac OS X, Ctrl-Alt on Windows and Linux */
|
||||||
static final int SHORTCUT_ALT_KEY_MASK = ActionEvent.ALT_MASK |
|
static final int SHORTCUT_ALT_KEY_MASK = ActionEvent.ALT_MASK |
|
||||||
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
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
|
* true if this file has not yet been given a name by the user
|
||||||
@ -670,9 +673,22 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
item.addActionListener(event -> handleExport(false));
|
item.addActionListener(event -> handleExport(false));
|
||||||
sketchMenu.add(item);
|
sketchMenu.add(item);
|
||||||
|
|
||||||
item = newJMenuItemShift(tr("Upload Using Programmer"), 'U');
|
// Since CTRL+SHIFT+U is not working on iBus keyboard input method
|
||||||
item.addActionListener(event -> handleExport(true));
|
// Lets redirect the shorcut for Linux to CTRL+ALT+U
|
||||||
sketchMenu.add(item);
|
// Leaving the preexisting behaviour for Windows & Mac OS
|
||||||
|
String OS = System.getProperty("os.name").toLowerCase();
|
||||||
|
if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0)
|
||||||
|
{
|
||||||
|
item = newJMenuItemAlt(tr("Upload Using Programmer"), 'U');
|
||||||
|
item.addActionListener(event -> handleExport(true));
|
||||||
|
sketchMenu.add(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item = newJMenuItemShift(tr("Upload Using Programmer"), 'U');
|
||||||
|
item.addActionListener(event -> handleExport(true));
|
||||||
|
sketchMenu.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
item = newJMenuItemAlt(tr("Export compiled Binary"), 'S');
|
item = newJMenuItemAlt(tr("Export compiled Binary"), 'S');
|
||||||
item.addActionListener(event -> {
|
item.addActionListener(event -> {
|
||||||
@ -1350,7 +1366,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
// Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
|
// Control + Shift + K seems to not be working on linux (Xubuntu 17.04, 2017-08-19)
|
||||||
static public JMenuItem newJMenuItemShift(String title, int what) {
|
static public JMenuItem newJMenuItemShift(String title, int what) {
|
||||||
JMenuItem menuItem = new JMenuItem(title);
|
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;
|
return menuItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user