Skip to content

Commit

Permalink
Update keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Feb 20, 2024
1 parent 96e2f1b commit 7727859
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,15 @@ implemented:
* Ctrl+Shift+E – View mode
* Ctrl+F – Search
* Ctrl+Shift+F – Close search
* Ctrl+G – Go to
* Ctrl+N – New file
* Ctrl+O – Open file
* Ctrl+S – Save file
* Ctrl+Shift+S – Save as
* Ctrl++ – Increase text size
* Ctrl+- – Decrease text size
* F3 – Find next
* F10 – Show menu

### SD cards
Android allows removable SD cards to be used like a USB stick or as
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/billthefarmer/editor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1234,13 +1234,14 @@ public boolean onKeyDown(int keyCode, KeyEvent event)
break;
// Increase text size
case KeyEvent.KEYCODE_PLUS:
case KeyEvent.KEYCODE_EQUALS:
size += 2;
size = Math.max(TINY, Math.min(size, HUGE));
textView.setTextSize(size);
break;
// Decrease text size
case KeyEvent.KEYCODE_MINUS:
size += 2;
size -= 2;
size = Math.max(TINY, Math.min(size, HUGE));
textView.setTextSize(size);
break;
Expand All @@ -1265,10 +1266,14 @@ public boolean onKeyDown(int keyCode, KeyEvent event)
// Menu
case KeyEvent.KEYCODE_F10:
openOptionsMenu();
break;

default:
return super.onKeyDown(keyCode, event);
}
}

return super.onKeyDown(keyCode, event);
return true;
}
}

// editClicked
Expand Down

0 comments on commit 7727859

Please sign in to comment.