Skip to content

Commit 4185c2e

Browse files
Shigeru KANEMOTOFederico Fissore
authored andcommitted
Fix: "Ctrl+," and "Ctrl+/"
Linux and Windows: If you press "Ctrl+," to invoke the preferences dialog, the file on editor will be marked as "modified". This behavior fixed. Linux: If you press "Ctrl+/" to comment the line, the line will be replaced with a single "/" letter. This behavior fixed.
1 parent 6a59764 commit 4185c2e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/processing/app/EditorListener.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ public boolean keyPressed(KeyEvent event) {
128128
event.consume(); // does nothing
129129
return false;
130130
}
131+
132+
// The char is not control code when CTRL key pressed? It should be a shortcut.
133+
if (c >= ' ') {
134+
event.consume();
135+
return true;
136+
}
131137
}
132138

133139
if ((event.getModifiers() & KeyEvent.META_MASK) != 0) {
@@ -480,8 +486,8 @@ public boolean keyTyped(KeyEvent event) {
480486
char c = event.getKeyChar();
481487

482488
if ((event.getModifiers() & KeyEvent.CTRL_MASK) != 0) {
483-
// on linux, ctrl-comma (prefs) being passed through to the editor
484-
if (c == KeyEvent.VK_COMMA) {
489+
// The char is not control code when CTRL key pressed? It should be a shortcut.
490+
if (c >= ' ') {
485491
event.consume();
486492
return true;
487493
}

0 commit comments

Comments
 (0)