Skip to content

Commit 6cd7b8b

Browse files
committed
Minor shortcut tweaks
1 parent dd31f68 commit 6cd7b8b

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

common/src/main/java/org/geogebra/common/main/GlobalKeyDispatcher.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -389,34 +389,25 @@ protected boolean handleGeneralKeys(KeyCodes key, boolean isShiftDown,
389389

390390
// eventually make an undo point (e.g. after zooming)
391391
app.storeUndoInfoIfSetCoordSystemOccured();
392-
393392
boolean consumed = false;
394393

395394
// ESC and function keys
396395
switch (key) {
397396
default:
398-
// do nothing
399397
break;
398+
case ENTER:
399+
// set focus to input field
400+
if (!fromSpreadsheet)
401+
handleEnter();
402+
// Fallback to detach focus
400403
case ESCAPE:
401-
402-
// ESC: set move mode
403404
handleEscForDropdown();
404405
if (!app.isApplet() || app.showToolBar()) {
405406
app.setMoveMode();
406407
}
407408
consumed = true;
408409
break;
409410

410-
case ENTER:
411-
// check not spreadsheet
412-
if (!fromSpreadsheet) {
413-
414-
// ENTER: set focus to input field
415-
consumed = handleEnter();
416-
417-
}
418-
break;
419-
420411
// toggle boolean or run script when Spacebar pressed
421412
case SPACE:
422413
// check not spreadsheet

desktop/src/main/java/org/geogebra/desktop/main/GlobalKeyDispatcherD.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,29 +137,26 @@ private boolean handleKeyTyped(KeyEvent event) {
137137
if (ch == 'k') cmd = "Circle";
138138
if (ch == 'h') cmd = "Dilate";
139139
if (ch == 'f') cmd = "Foot";
140-
if (ch == '\'') cmd = "SetColor";
140+
if (ch == '\'')cmd = "SetColor";
141141
if (ch == '"') cmd = "SetLineStyle";
142142
if (ch == 'i') cmd = "Intersect";
143143
if (ch == 'l') cmd = "Line";
144144
if (ch == 'b') cmd = "PerpendicularBisector";
145145
if (ch == 'p') cmd = "PerpendicularLine";
146146
if (ch == '.') cmd = "Point";
147-
if (ch == '>') {
148-
this.app.setMode(EuclidianConstants.MODE_POINT);
149-
return true;
150-
}
151147
if (ch == ',') cmd = "Polar";
152148
if (ch == 'g') cmd = "Polygon";
153149
if (ch == 'r') cmd = "Reflect";
154150
if (ch == 'o') cmd = "Rotate";
155-
if (ch == 's') {
156-
this.app.setMoveMode();
157-
return true;
158-
}
151+
if (ch == 's') cmd = "Segment";
159152
if (ch == 't') cmd = "Tangent";
160153
if (ch == 'y') cmd = "Translate";
161154
if (ch == 'c') cmd = "TriangleCenter";
162155
if (ch == 'v') cmd = "Vector";
156+
if (ch == '>') {
157+
this.app.setMode(EuclidianConstants.MODE_POINT);
158+
return true;
159+
}
163160

164161
if (cmd != null) {
165162
algIn.insertCommand(cmd);

0 commit comments

Comments
 (0)