Add opt-in keyboard swipe shortcuts#5
Merged
Conversation
Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/361e11ed-94d0-447f-b61f-f6ce16ce71ad Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com>
Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/361e11ed-94d0-447f-b61f-f6ce16ce71ad Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com>
Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/361e11ed-94d0-447f-b61f-f6ce16ce71ad Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AsafMah
May 22, 2026 03:37
View session
There was a problem hiding this comment.
Pull request overview
Adds opt-in swipe-based “shortcut” actions (undo/redo/emoji) to the keyboard without introducing a dedicated shortcut layer, configured via new gesture-typing settings.
Changes:
- Added new gesture settings for backspace up/down swipe, emoji-key swipe, and configurable top-row swipe-up action (defaults off / none).
- Wired new preferences into settings storage (
Defaults,Settings,SettingsValues) including mapping top-row action strings to key codes. - Extended
PointerTrackerswipe handling to dispatch undo/redo/emoji codes and to recognize top-row swipe-up shortcuts.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds user-facing titles/summaries for the new swipe shortcut settings. |
| app/src/main/java/helium314/keyboard/settings/screens/GestureTypingScreen.kt | Exposes the new preferences in the Gesture settings screen (switches + list preference). |
| app/src/main/java/helium314/keyboard/latin/settings/SettingsValues.java | Adds stored runtime settings values for the new swipe shortcut toggles and top-row action key code. |
| app/src/main/java/helium314/keyboard/latin/settings/Settings.java | Defines new preference keys and adds a reader to map top-row action selection to a KeyCode. |
| app/src/main/java/helium314/keyboard/latin/settings/Defaults.kt | Adds defaults for the new swipe shortcut preferences (off/none). |
| app/src/main/java/helium314/keyboard/keyboard/PointerTracker.java | Implements the new swipe gesture behaviors (backspace up/down, emoji swipe up, top-row swipe up shortcut). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1347
to
+1356
| private boolean isTopVisibleRowKey(final Key key) { | ||
| if (key == null || mKeyboard == null || key.isSpacer() || !key.isEnabled()) { | ||
| return false; | ||
| } | ||
| int top = Integer.MAX_VALUE; | ||
| for (final Key candidate : mKeyboard.getSortedKeys()) { | ||
| if (!candidate.isSpacer() && candidate.isEnabled() && candidate.getHeight() > 0) { | ||
| top = Math.min(top, candidate.getY()); | ||
| } | ||
| } |
Comment on lines
+1360
to
+1365
| private boolean tryHandleTopRowSwipe(final Key key, final int x, final int y) { | ||
| if (mShortcutSwipeConsumed) { | ||
| return true; | ||
| } | ||
| final int actionCode = Settings.getValues().mTopRowSwipeUpKeyCode; | ||
| if (actionCode == KeyCode.UNSPECIFIED || !mStartedOnTopRow || sInGesture) { |
- isTopVisibleRowKey: skip computation when setting disabled; use first eligible key from sorted list (O(1) instead of O(n) scan) - tryHandleTopRowSwipe: exclude modifier keys so SHIFT/SYMBOL/ALPHA/NUMPAD always complete their normal press/release flow Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/4a8fd5b5-0a68-45de-affc-8699d4563ec3 Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com>
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Remove the direct-action top-row/backspace/emoji swipe shortcut implementation because it does not match the agreed direction for shortcut rows/layers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implement opt-in top and bottom shortcut rows using existing layout parsing and popup-key slide-to-select behavior instead of hardcoded direct actions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…board-shortcuts # Conflicts: # dev-log.md
Anchor bottom shortcut row popups below the source key while preserving the normal above-key placement for top rows and long-press popups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…board-shortcuts # Conflicts: # dev-log.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove duplicate ToolbarUtils imports introduced by the main merge and record the shortcuts branch install validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AsafMah
marked this pull request as ready for review
May 26, 2026 06:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shortcut-layer concept is reduced to direct, opt-in swipe actions because top/bottom edge swipes only expose one row of usable targets. This adds undo/redo and emoji shortcuts without introducing temporary keyboard layers.
Settings
Swipe actions
Gesture handling