Conversation
…tItem focus - Replace _lastPageLeft/Right ReferenceEquals polling with DP hook on PanMainLeft/Right.Child - Replace _pendingFocusTargetLeft toggle with IsFocusOnLeftPage() visual tree walk - Set Focusable=true in SetCanSelect so MyListItem (Grid) and other controls accept focus - Reject non-selectable destinations in MoveFocus to prevent highlight loss - Invert scroll direction (thumb up = scroll up) - CheckPageChanged now tries both pages - Save/restore focus on title bar mode enter/exit
…HighlightFromFocus - Extract HideHighlight() to reduce redundant null checks - Extract GetForm() to avoid repeating ModMain.FrmMain - Split GetTitleBarButton(int) into GetTitleBarButton() + MoveTitleBarIndex(int) - Fix double UpdateHighlightFromFocus() in title bar input path - Simplify CheckPageChanged to avoid array allocation - Store _pageChildProp for DP handler cleanup on Shutdown - Set _pendingPageFocus = true at declaration - Remove duplicate OnPageChildChanged method
- Add PerformClick() to MyListItem, extracting click logic from Button_MouseUp without IsMouseDirectlyOver dependency - Add MyListItem special case in KeyControllAbility.Activate() - A button now works on MyListItem (Clickable/RadioBox/CheckBox)
ModGamepad.cs (144 lines) — fields, constants, public API, polling loop ModGamepadHighlight.cs (178 lines) — overlay creation, highlight positioning, event handlers ModGamepadInput.cs (196 lines) — button dispatch, title bar mode, simulate, dialog ModGamepadNavigation.cs (108 lines) — focus navigation, page tracking, scope stack
…s.Gamepad namespace
Reviewer's Guide通过引入通用的键盘/手柄焦点/激活辅助工具,接入 FormMain 的手柄生命周期,实现基于控制器的导航、激活、滚动、标题栏控制、对话框交互,以及在现有自定义控件上的可视高亮,从而新增对 Xbox 控制器的支持。 手柄 A 键激活流程的时序图sequenceDiagram
participant Controller
participant ModGamepad
participant KeyControllAbility
participant Control as FocusedControl
participant MyListItem
participant MyCard
Controller->>ModGamepad: GetState()
ModGamepad->>ModGamepad: HandleButtonPress(GamepadButtonFlags.A)
ModGamepad->>KeyControllAbility: Activate(FocusedControl)
alt FocusedControl is MyCard with SwapControl
KeyControllAbility->>MyCard: ToggleSwap()
else FocusedControl is MyListItem
KeyControllAbility->>MyListItem: PerformClick()
else Other control
KeyControllAbility->>Control: RaiseEvent(MouseLeftButtonDownEvent)
KeyControllAbility->>Control: RaiseEvent(MouseLeftButtonUpEvent)
end
ModGamepad->>ModGamepad: UpdateHighlightFromFocus()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience打开你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideAdds Xbox controller support by introducing a generic keyboard/gamepad focus/activation helper, wiring gamepad lifecycle into FormMain, and implementing controller-driven navigation, activation, scrolling, title bar control, dialog interaction, and visual highlighting across existing custom controls. Sequence diagram for gamepad A button activation flowsequenceDiagram
participant Controller
participant ModGamepad
participant KeyControllAbility
participant Control as FocusedControl
participant MyListItem
participant MyCard
Controller->>ModGamepad: GetState()
ModGamepad->>ModGamepad: HandleButtonPress(GamepadButtonFlags.A)
ModGamepad->>KeyControllAbility: Activate(FocusedControl)
alt FocusedControl is MyCard with SwapControl
KeyControllAbility->>MyCard: ToggleSwap()
else FocusedControl is MyListItem
KeyControllAbility->>MyListItem: PerformClick()
else Other control
KeyControllAbility->>Control: RaiseEvent(MouseLeftButtonDownEvent)
KeyControllAbility->>Control: RaiseEvent(MouseLeftButtonUpEvent)
end
ModGamepad->>ModGamepad: UpdateHighlightFromFocus()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
蹭个编译产物的,暂时不合并
Sourcery 总结
在主窗口以及常用控件中添加初步的 Xbox 手柄导航和激活支持。
新功能:
增强:
Original summary in English
Summary by Sourcery
Add initial Xbox gamepad navigation and activation support across the main window and common controls.
New Features:
Enhancements: