Enhance gamepad shortcuts and accessibility documentation#13
Conversation
- 新增片語子選單的 LB/RB/LT/RT 分頁快捷與回饋。 - 補上主輸入框 LT/RT 游標跳位、多語系資源與 README 說明。 - 清理不必要的 pragma 抑制並補上相關回歸測試。
更新程式碼註解。
There was a problem hiding this comment.
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
|
@copilot apply changes based on the comments in this thread |
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>
Applied both changes from the review thread:
|
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:
LeftShoulderPressedandRightShoulderPressedevents toIGamepadController,GameInputGamepadController, andXInputGamepadController, 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]GamepadEventBinder.BindingMapand 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:
MainForm.ContextMenu.csto 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]PageSwitch) for page navigation to provide clearer haptic feedback when switching pages.Documentation and accessibility:
README.mdto 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]Minor code improvements:
GamepadMessageBox.cs.These changes collectively provide a more intuitive and responsive experience for users navigating with a gamepad, especially in phrase menu scenarios.