Skip to content

Enhance gamepad shortcuts and accessibility documentation#13

Merged
perditavojo merged 4 commits into
mainfrom
dev
Apr 17, 2026
Merged

Enhance gamepad shortcuts and accessibility documentation#13
perditavojo merged 4 commits into
mainfrom
dev

Conversation

@perditavojo
Copy link
Copy Markdown
Contributor

This pull request introduces enhanced support for gamepad navigation, especially for phrase menu paging, and improves code clarity and accessibility feedback. The main changes are the addition of LB/RB/LT/RT (shoulder and trigger) button event handling throughout the codebase, new phrase menu navigation features, and improved documentation and feedback for these interactions.

Gamepad event handling and interface expansion:

  • Added LeftShoulderPressed and RightShoulderPressed events to IGamepadController, GameInputGamepadController, and XInputGamepadController, with appropriate event detection and clearing logic. This enables the app to respond to LB/RB button presses. [1] [2] [3] [4] [5] [6] [7]
  • Updated GamepadEventBinder.BindingMap and its usage to include handlers for LB/RB/LT/RT, and improved XML documentation for all event handlers. [1] [2] [3] [4]

Phrase menu navigation improvements:

  • Implemented methods in MainForm.ContextMenu.cs to allow phrase menu paging via LB/RB (previous/next page) and LT/RT (jump to first/last page). These methods provide vibration and accessibility feedback, and are now invoked from both UI and gamepad actions. [1] [2] [3] [4]
  • Added a new vibration pattern (PageSwitch) for page navigation to provide clearer haptic feedback when switching pages.

Documentation and accessibility:

  • Updated the README.md to document new gamepad shortcuts for phrase menu navigation (LB/RB for paging, LT/RT for jumping to boundaries), and clarified related behaviors. [1] [2] [3]
  • Improved accessibility feedback when opening the phrase submenu, including page information and shortcut hints. [1] [2]

Minor code improvements:

  • Simplified button list initialization in GamepadMessageBox.cs.
  • Clarified event documentation across several files for consistency and maintainability. [1] [2] [3]

These changes collectively provide a more intuitive and responsive experience for users navigating with a gamepad, especially in phrase menu scenarios.

- 新增片語子選單的 LB/RB/LT/RT 分頁快捷與回饋。
- 補上主輸入框 LT/RT 游標跳位、多語系資源與 README 說明。
- 清理不必要的 pragma 抑制並補上相關回歸測試。
更新程式碼註解。
Copilot AI review requested due to automatic review settings April 17, 2026 02:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances gamepad navigation by adding shoulder-button (LB/RB) events end-to-end, enabling phrase submenu paging/jump shortcuts, and updating accessibility/help documentation and resources accordingly.

Changes:

  • Expanded IGamepadController + implementations/binding to support LB/RB pressed events and updated related docs.
  • Added phrase submenu paging/jump actions (LB/RB paging; LT/RT jump to first/last page) with haptic + a11y feedback.
  • Updated localized resources/README and added regression tests for the new binding surface.

Reviewed changes

Copilot reviewed 21 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/InputBox.Tests/TaskExtensionsTests.cs Adjusted cancellation test to avoid analyzer suppression (but see review note).
tests/InputBox.Tests/RestartRequestDeciderTests.cs Formatting/EOF alignment.
tests/InputBox.Tests/RestartPromptStateTests.cs Formatting/EOF alignment.
tests/InputBox.Tests/README.md Updated test inventory to include new binder test and total count.
tests/InputBox.Tests/GamepadMessageBoxTests.cs Updated stub controller to include LB/RB events and avoid unused-event pragmas.
tests/InputBox.Tests/GamepadEventBinderTests.cs New regression test ensuring LB/RB/LT/RT bindings invoke mapped handlers.
tests/InputBox.Tests/AppSettingsTestCollection.cs Formatting/BOM + EOF alignment.
src/InputBox/Resources/Strings.zh-Hant.resx Added LT/RT + phrase paging/jump hints and new phrase submenu shortcut string.
src/InputBox/Resources/Strings.zh-Hans.resx Same as above (Simplified Chinese).
src/InputBox/Resources/Strings.resx Same as above (neutral/English).
src/InputBox/Resources/Strings.ko.resx Same as above (Korean).
src/InputBox/Resources/Strings.ja.resx Same as above (Japanese).
src/InputBox/Resources/Strings.fr.resx Same as above (French).
src/InputBox/Resources/Strings.de.resx Same as above (German).
src/InputBox/Resources/Strings.Designer.cs Regenerated designer to expose new resource key(s) and updated string docs.
src/InputBox/MainForm.Gamepad.cs Wired LB/RB/LT/RT handlers; added cursor boundary jump via LT/RT outside menus.
src/InputBox/MainForm.ContextMenu.cs Refactored phrase submenu announcement and added paging/jump helpers with feedback.
src/InputBox/Core/Services/RestartRequirementSnapshot.cs Formatting/EOF alignment.
src/InputBox/Core/Services/RestartRequestDecider.cs Formatting/EOF alignment.
src/InputBox/Core/Services/RestartMenuTextResolver.cs Formatting/EOF alignment.
src/InputBox/Core/Input/XInputGamepadController.cs Added LB/RB pressed events, detection, and event clearing; improved XML docs.
src/InputBox/Core/Input/IGamepadController.cs Added LB/RB pressed events to the interface.
src/InputBox/Core/Input/GamepadEventBinder.cs Expanded binding map + binder wiring for LB/RB/LT/RT; improved XML docs.
src/InputBox/Core/Input/GameInputGamepadController.cs Added LB/RB pressed events, detection, and event clearing; improved XML docs.
src/InputBox/Core/Feedback/VibrationPatterns.cs Added PageSwitch vibration profile for page navigation feedback.
src/InputBox/Core/Controls/GamepadMessageBox.cs Simplified button list initialization using collection expressions.
README.md Documented LT/RT cursor boundary jump and phrase submenu paging/jump shortcuts.
Files not reviewed (1)
  • src/InputBox/Resources/Strings.Designer.cs: Language not supported

Comment thread tests/InputBox.Tests/TaskExtensionsTests.cs Outdated
Comment thread src/InputBox/MainForm.ContextMenu.cs Outdated
@perditavojo
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

perditavojo and others added 2 commits April 17, 2026 10:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: perditavojo <117562794+perditavojo@users.noreply.github.com>
…s in TaskExtensionsTests

Agent-Logs-Url: https://github.com/rubujo/InputBox/sessions/62040265-fa4f-4616-912d-bbf953e82de9

Co-authored-by: perditavojo <117562794+perditavojo@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot apply changes based on the comments in this thread

Applied both changes from the review thread:

  1. MainForm.ContextMenu.cs:2142 — The Chinese period separator was already replaced with a plain space in commit b17e056.

  2. TaskExtensionsTests.cs:143-146 — Replaced Task.Run(…, TestContext.Current.CancellationToken) with Task.FromCanceled(cts.Token) in commit 24b5292. The task is now genuinely in Canceled state (not Faulted), matching the test's semantic intent of verifying that a truly cancelled task does not invoke onException.

@perditavojo perditavojo merged commit cf7a3fd into main Apr 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants