Add touchscreen keyboard and inverted pan actions#1522
Conversation
📝 WalkthroughWalkthroughThis PR extends GameNative's touch gesture system with inverted pan action variants and expanded keyboard binding support. New keyboard keys (symbol and numpad) are added to the Binding enum, inverted pan actions are defined in TouchGestureConfig, gesture handling is implemented in TouchpadView, the settings dialog is updated with new keyboard categories and binding-aware label resolution, and supporting localization strings are added. ChangesKeyboard Binding and Pan Action Expansion
Sequence Diagram(s)User interaction with the inverted pan gesture system involves component interaction across the touch gesture settings dialog, binding resolution, and touchpad action handling. However, the changes constitute straightforward configuration and handler extension rather than multi-component sequential flows, so a sequence diagram is not applicable. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4c1bd04 to
f5d1364
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/winlator/inputcontrols/Binding.java (1)
76-85:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse explicit labels for Print Screen and numpad add in
toString().At Line 77 and Line 85,
KEY_KP_ADDrenders as"+"andKEY_PRTSCNfalls back to"PRTSCN". Since UI search/display depends onBinding.toString(), these are harder to discover than the other explicit key labels.🔧 Proposed fix
case KEY_KP_ADD: - return "+"; + return "NUMPAD +"; case KEY_KP_DEL: return "NUMPAD ."; + case KEY_PRTSCN: + return "PRINT SCREEN"; case SHOW_KEYBOARD: return "SHOW KEYBOARD";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/winlator/inputcontrols/Binding.java` around lines 76 - 85, The Binding.toString() fallback makes KEY_KP_ADD and KEY_PRTSCN hard to discover; update Binding.toString() to add explicit case entries for KEY_KP_ADD (map to a clear label like "NUMPAD +") and KEY_PRTSCN (map to "PRINT SCREEN") instead of relying on the generic replace logic so the UI search/display shows consistent, discoverable labels; modify the switch in Binding.toString() (the method handling cases like KEY_KP_ADD, KEY_KP_DEL, SHOW_KEYBOARD, ALT_ENTER and the default) to include these two explicit cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@app/src/main/java/com/winlator/inputcontrols/Binding.java`:
- Around line 76-85: The Binding.toString() fallback makes KEY_KP_ADD and
KEY_PRTSCN hard to discover; update Binding.toString() to add explicit case
entries for KEY_KP_ADD (map to a clear label like "NUMPAD +") and KEY_PRTSCN
(map to "PRINT SCREEN") instead of relying on the generic replace logic so the
UI search/display shows consistent, discoverable labels; modify the switch in
Binding.toString() (the method handling cases like KEY_KP_ADD, KEY_KP_DEL,
SHOW_KEYBOARD, ALT_ENTER and the default) to include these two explicit cases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 863eb1fa-5502-4187-8c6c-eeef341215c9
📒 Files selected for processing (5)
app/src/main/java/app/gamenative/data/TouchGestureConfig.ktapp/src/main/java/app/gamenative/ui/component/dialog/TouchGestureSettingsDialog.ktapp/src/main/java/com/winlator/inputcontrols/Binding.javaapp/src/main/java/com/winlator/widget/TouchpadView.javaapp/src/main/res/values/strings.xml
Description
This is a requested feature from here (asking for Insert):
https://discord.com/channels/1378308569287622737/1511122055574327356
Inverted arrow keys feature request here: https://discord.com/channels/1378308569287622737/1509675164273475685/1509675164273475685
This PR adds missing keyboard actions to the control action list, including END, INSERT, =, `, Print Screen, and missing numpad operator keys.
This also adds all keyboard actions to the touch gesture actions list as well.
Also adds inverted arrow keys, inverted WASD, inverted middle mouse pan actions to drag, 2F drag and 3F drag gestures.
Recording
Screen_Recording_20260604_195213_GameNative.mp4
Screen_Recording_20260604_223634_GameNative.mp4
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Adds a touchscreen “Show Keyboard” action and inverted pan options to make touch navigation more flexible. Also expands the touch gesture action list with missing keys and clearer labels.
Binding.Written for commit f5d1364. Summary will update on new commits.
Summary by CodeRabbit
New Features