mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
Better tab switching but still unable to switch backwards (CTRL+SHIFT+TAB)
This commit is contained in:
parent
59238a22b7
commit
455fecff13
@ -989,6 +989,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
|
||||
private SketchTextArea createTextArea() throws IOException {
|
||||
final SketchTextArea textArea = new SketchTextArea(base.getPdeKeywords());
|
||||
textArea.setFocusTraversalKeysEnabled(false);
|
||||
textArea.requestFocusInWindow();
|
||||
textArea.setMarkOccurrences(PreferencesData.getBoolean("editor.advanced"));
|
||||
textArea.setMarginLineEnabled(false);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package processing.app;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
|
||||
@ -17,12 +17,9 @@ public class EditorListener implements KeyListener {
|
||||
}
|
||||
|
||||
/** ctrl-alt on windows and linux, cmd-alt on mac os x */
|
||||
static final int CTRL_ALT = ActionEvent.ALT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
||||
|
||||
static final int CTRL_SHIFT = ActionEvent.SHIFT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
||||
|
||||
static final int CTRL = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
||||
|
||||
private static final int CTRL = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
|
||||
private static final int CTRL_ALT = InputEvent.ALT_MASK | CTRL;
|
||||
private static final int CTRL_SHIFT = InputEvent.SHIFT_MASK | CTRL;
|
||||
|
||||
public void keyTyped(KeyEvent event) {
|
||||
char c = event.getKeyChar();
|
||||
@ -37,7 +34,7 @@ public class EditorListener implements KeyListener {
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent event) {
|
||||
|
||||
|
||||
SketchTextArea textarea = editor.getTextArea();
|
||||
|
||||
if (!textarea.isEditable()) return;
|
||||
@ -53,8 +50,7 @@ public class EditorListener implements KeyListener {
|
||||
|
||||
// Navigation..
|
||||
// FIXME: not working on LINUX !!!
|
||||
if (((event.getModifiers() & CTRL_SHIFT) == CTRL_SHIFT)) {
|
||||
if(code == KeyEvent.VK_TAB)
|
||||
if ((event.getModifiers() & CTRL_SHIFT) == CTRL_SHIFT && code == KeyEvent.VK_TAB) {
|
||||
sketch.handlePrevCode();
|
||||
}
|
||||
|
||||
@ -80,4 +76,4 @@ public class EditorListener implements KeyListener {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user