Skip to content

Commit

Permalink
Minor shortcut tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mstfelg committed Apr 2, 2023
1 parent dd31f68 commit 6cd7b8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,34 +389,25 @@ protected boolean handleGeneralKeys(KeyCodes key, boolean isShiftDown,

// eventually make an undo point (e.g. after zooming)
app.storeUndoInfoIfSetCoordSystemOccured();

boolean consumed = false;

// ESC and function keys
switch (key) {
default:
// do nothing
break;
case ENTER:
// set focus to input field
if (!fromSpreadsheet)
handleEnter();
// Fallback to detach focus
case ESCAPE:

// ESC: set move mode
handleEscForDropdown();
if (!app.isApplet() || app.showToolBar()) {
app.setMoveMode();
}
consumed = true;
break;

case ENTER:
// check not spreadsheet
if (!fromSpreadsheet) {

// ENTER: set focus to input field
consumed = handleEnter();

}
break;

// toggle boolean or run script when Spacebar pressed
case SPACE:
// check not spreadsheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,26 @@ private boolean handleKeyTyped(KeyEvent event) {
if (ch == 'k') cmd = "Circle";
if (ch == 'h') cmd = "Dilate";
if (ch == 'f') cmd = "Foot";
if (ch == '\'') cmd = "SetColor";
if (ch == '\'')cmd = "SetColor";
if (ch == '"') cmd = "SetLineStyle";
if (ch == 'i') cmd = "Intersect";
if (ch == 'l') cmd = "Line";
if (ch == 'b') cmd = "PerpendicularBisector";
if (ch == 'p') cmd = "PerpendicularLine";
if (ch == '.') cmd = "Point";
if (ch == '>') {
this.app.setMode(EuclidianConstants.MODE_POINT);
return true;
}
if (ch == ',') cmd = "Polar";
if (ch == 'g') cmd = "Polygon";
if (ch == 'r') cmd = "Reflect";
if (ch == 'o') cmd = "Rotate";
if (ch == 's') {
this.app.setMoveMode();
return true;
}
if (ch == 's') cmd = "Segment";
if (ch == 't') cmd = "Tangent";
if (ch == 'y') cmd = "Translate";
if (ch == 'c') cmd = "TriangleCenter";
if (ch == 'v') cmd = "Vector";
if (ch == '>') {
this.app.setMode(EuclidianConstants.MODE_POINT);
return true;
}

if (cmd != null) {
algIn.insertCommand(cmd);
Expand Down

0 comments on commit 6cd7b8b

Please sign in to comment.