Skip to content

Enhance gamepad feedback and fix interaction issues#14

Merged
perditavojo merged 7 commits into
mainfrom
dev
Apr 18, 2026
Merged

Enhance gamepad feedback and fix interaction issues#14
perditavojo merged 7 commits into
mainfrom
dev

Conversation

@perditavojo
Copy link
Copy Markdown
Contributor

This pull request introduces several usability improvements and feedback enhancements for game controller and text input interactions, particularly in the phrase editing and numeric input dialogs. The changes focus on more granular and responsive text selection, improved feedback as text approaches length limits, and better configuration flexibility for application data directories.

Game controller enhancements:

  • Expanded support for both LB and RB shoulder buttons for word-jump navigation and word-granularity selection in both numeric and phrase edit dialogs. This allows users to use either shoulder button for these actions, increasing accessibility. [1] [2] [3]
  • Added a "burst" feedback mechanism for rapid right-stick text selection, providing tactile and audio cues that scale with selection speed, and distinguishing between character and word-level selection. (F451ce51L754R786, [1] [2]
  • Updated documentation to reflect these new controller shortcuts and behaviors, including rapid history navigation, privacy mode toggling, and improved feedback for various actions. [1] [2] [3] [4]

Text input feedback improvements:

  • Implemented real-time feedback as users approach or reach text length limits in phrase name/content fields, with both visual and haptic cues. Attempting to input beyond the limit now triggers a distinct "hard wall" feedback to prevent confusion. [1] [2] [3] [4]
  • Adjusted label sizing and updating logic to ensure character count displays remain clear and consistent as text changes. [1] [2] [3]

Configuration and infrastructure:

  • Added support for overriding the configuration directory via the INPUTBOX_CONFIG_DIRECTORY environment variable, improving flexibility for deployment and testing scenarios.

Other improvements:

Summary of most important changes:

Controller and Interaction Enhancements

  • Expanded LB/RB support for word-jump and selection granularity in both numeric and phrase dialogs, improving accessibility and consistency. [1] [2]
  • Added burst-based tactile/audio feedback for rapid right-stick selection, distinguishing between character and word-level operations. (F451ce51L754R786, [1] [2]
  • Updated README documentation to reflect new and clarified controller shortcuts, feedback, and behaviors. [1] [2] [3] [4]

Text Input Feedback

  • Introduced real-time feedback for nearing or exceeding text length limits in phrase dialogs, including "hard wall" feedback on overflow attempts. [1] [2]
  • Improved label sizing and updating for character count displays to maintain clarity as input changes. [1] [2] [3]

Configuration

  • Enabled overriding of the configuration directory via the INPUTBOX_CONFIG_DIRECTORY environment variable for more flexible setups.

- 新增多段式與方向性感知的控制器觸覺回饋
- 強化主輸入區、片語編輯與數值輸入對話框的選取與歷程操作手感
- 同步更新 README 與測試說明
- 新增震動強度即時與重設預覽回饋
- 在快速鍵喚醒與重設校準時同步單次視覺脈衝
- 鎖定片語對話框動態計數標籤寬度並補上回歸測試
- 修正回饋重設後的輔助播報內容
- 確保播報與目前回饋設定狀態一致
- 新增肩鍵單按、連發與雙肩組合的仲裁流程
- 補上組合提示回饋與對應回歸測試
- 同步整理相關 C# 註解與測試文件
調整右鍵選單與片語子選單的確認與分頁行為,避免 Space 覆寫原生行為並維持控制器導覽連續性。

同時讓測試一律使用獨立設定目錄,避免自動化驗證覆寫使用者的實際片語資料。
移除主輸入區、片語子選單與片語管理中不需要的 LT/RT 連發行為,保留真正適合長按的翻頁情境。

同步更新主 README、應用程式內說明與多語系資源,並補上對應回歸測試。
Copilot AI review requested due to automatic review settings April 17, 2026 23:46
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

This PR expands the gamepad UX and feedback system across the main input flow and dialogs by introducing direction-aware / multi-step vibration patterns, richer controller shortcuts (including LB/RB parity), improved context-menu keyboard routing, and test/config isolation improvements.

Changes:

  • Introduces directional + multi-step vibration profiles/sequences and routes navigation/selection feedback through a semantic/context-based resolver.
  • Improves gamepad and keyboard interaction flow (history paging, phrase menu paging persistence, context-menu keyboard routing, phrase manager shortcuts, and text-limit feedback).
  • Adds/extends regression tests and isolates test config I/O via INPUTBOX_CONFIG_DIRECTORY.

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/InputBox.Tests/VibrationPatternsTests.cs Adds coverage for new vibration semantics, sequences, directional scaling, and FeedbackService integration.
tests/InputBox.Tests/TestEnvironmentSetup.cs Adds ModuleInitializer to isolate config directory for tests via env var.
tests/InputBox.Tests/RestartPromptStateTests.cs Cleans up imports after config isolation changes.
tests/InputBox.Tests/README.md Updates test inventory/counts to reflect new/expanded tests.
tests/InputBox.Tests/PhraseServiceTests.cs Serializes phrase data tests via a shared collection to avoid file contention.
tests/InputBox.Tests/PhraseManagerDialogGamepadTests.cs Adds regression tests for phrase manager LB/RB/LT/RT navigation shortcuts.
tests/InputBox.Tests/PhraseDataTestCollection.cs Defines a non-parallel test collection for phrase data file access.
tests/InputBox.Tests/InputHistoryServiceTests.cs Adds tests for new page-based history navigation API.
tests/InputBox.Tests/GamepadShoulderShortcutArbiterTests.cs Adds tests for the new shoulder shortcut arbitration helper.
tests/InputBox.Tests/GamepadMessageBoxTests.cs Updates stubs to match expanded IGamepadController vibration + button surface.
tests/InputBox.Tests/GamepadEventBinderTests.cs Extends binder test to include shoulder released/repeat events.
tests/InputBox.Tests/DialogLabelStabilityTests.cs Adds layout regression tests for fixed-width dynamic count labels.
tests/InputBox.Tests/CmdKeyDispatcherTests.cs Adds tests for context-menu keyboard→action translation.
src/InputBox/Resources/Strings.zh-Hant.resx Updates/extends localized a11y and help strings for new shortcuts and controller identify.
src/InputBox/Resources/Strings.zh-Hans.resx Same as above (Simplified Chinese).
src/InputBox/Resources/Strings.resx Same as above (default/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 accessors for added resource keys.
src/InputBox/MainForm.cs Adds text-limit feedback hooks and cmd-key routing for context menu visibility.
src/InputBox/MainForm.Events.cs Adds history page navigation path and integrates new navigation vibration semantics.
src/InputBox/MainForm.ContextMenu.cs Adds “Identify Controller”, improves phrase paging persistence, and adds vibration intensity preview/apply flow.
src/InputBox/Core/Services/PhraseService.cs Fixes temp-file unregister logic by retaining the registered temp path.
src/InputBox/Core/Services/InputHistoryService.cs Adds NavigatePage() API for fixed-step history paging.
src/InputBox/Core/Services/FeedbackService.cs Adds multi-motor vibration dispatch, vibration sequences, navigation vibration routing, and selection cue sound helper.
src/InputBox/Core/Services/CmdKeyDispatcher.cs Adds context-menu key translation into unified action strings.
src/InputBox/Core/Input/XInputGamepadController.cs Adds shoulder release/repeat tracking, X-hold state, motor capability surface, and multi-motor vibration overload.
src/InputBox/Core/Input/IGamepadController.cs Extends controller contract with shoulder release/repeat, X-hold, motor support, and profile-based vibration overload.
src/InputBox/Core/Input/GamepadShoulderShortcutArbiter.cs Adds arbitration logic for shoulder tap/repeat/modifier/dual-chord interactions.
src/InputBox/Core/Input/GamepadEventBinder.cs Extends binding map to include shoulder released/repeat handlers.
src/InputBox/Core/Input/GameInputGamepadController.cs Adds shoulder release/repeat tracking, X-hold state, motor capability surface, and multi-motor vibration overload.
src/InputBox/Core/Feedback/VibrationProfile.cs Expands vibration profile to include per-motor scales + sequence/support types.
src/InputBox/Core/Feedback/VibrationPatterns.cs Adds semantic/context-based vibration pattern resolution and many new directional/sequence patterns.
src/InputBox/Core/Controls/PhraseManagerDialog.cs Stabilizes phrase-count label sizing and adds gamepad shortcut handlers for list navigation.
src/InputBox/Core/Controls/PhraseEditDialog.cs Adds text-limit feedback (warning/wall) and burst-based selection feedback with word granularity via either shoulder.
src/InputBox/Core/Controls/NumericInputDialog.cs Adds burst-based selection feedback and expands LB/RB usage for word granularity.
src/InputBox/Core/Configuration/AppSettings.cs Adds INPUTBOX_CONFIG_DIRECTORY override support for config directory resolution.
README.md Updates end-user documentation for new shortcuts, feedback behaviors, and controller identify option.
Files not reviewed (1)
  • src/InputBox/Resources/Strings.Designer.cs: Language not supported

Comment thread src/InputBox/Core/Input/XInputGamepadController.cs Outdated
Comment thread src/InputBox/Core/Input/GameInputGamepadController.cs Outdated
Comment thread src/InputBox/Core/Input/GameInputGamepadController.cs
Comment thread src/InputBox/Core/Configuration/AppSettings.cs Outdated
@perditavojo
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

- XInputGamepadController: use profile.Strength (not GetPeakMotorStrength)
  as requestedStrength so each motor scale is applied exactly once via
  ScaleMotorStrength(safeStrength, motorScale).
- GameInputGamepadController: same fix; intensity = safeStrength/65535f is
  now multiplied by each motorScale once when building GameInputRumbleParams.
- AppSettings.ResolveConfigDirectory: wrap Path.GetFullPath() in try/catch
  (ArgumentException | NotSupportedException | PathTooLongException) and
  fall back to new GetDefaultConfigDirectory() helper, preventing a type-
  initialization crash when INPUTBOX_CONFIG_DIRECTORY holds an invalid path.

Agent-Logs-Url: https://github.com/rubujo/InputBox/sessions/a1ddedd3-c347-46ba-8064-7ec1dcdfc27e

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 all four changes from the review thread in commit d5c1ec1:

  • XInputGamepadController & GameInputGamepadController (double-scaling): Changed requestedStrength from profile.GetPeakMotorStrength() to profile.Strength in both controllers. The safety limiter now receives the unscaled base strength; each motor scale is applied exactly once — via ScaleMotorStrength(safeStrength, motorScale) in XInput and via intensity * motorScale in GameInput.

  • AppSettings.ResolveConfigDirectory: Wrapped Path.GetFullPath(overrideDirectory) in a try/catch for ArgumentException | NotSupportedException | PathTooLongException. On an invalid INPUTBOX_CONFIG_DIRECTORY value the error is logged via Debug.WriteLine and the method falls back to the new GetDefaultConfigDirectory() helper, preventing a type-initialization crash.

@perditavojo perditavojo merged commit 411f84a into main Apr 18, 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