Skip to content

Refactor HotkeyMenu, HotkeyBinder#2779

Draft
oznogon wants to merge 6 commits intodaid:masterfrom
oznogon:refactor-hotkeymenu-hotkeybinder
Draft

Refactor HotkeyMenu, HotkeyBinder#2779
oznogon wants to merge 6 commits intodaid:masterfrom
oznogon:refactor-hotkeymenu-hotkeybinder

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Mar 11, 2026

This draft demonstrates usage of #2775 and stacks on that PR. 2775 requires daid/SeriousProton#300, and CI will fail without SP 300.

Replace the bespoke HotkeyMenu pagination with GuiScrollContainer, and split the input field for each control into separate fields for keyboard, joystick, and mouse binds, with each input filtered by input device type. This also allows for mouse axis, wheel, and button binding.

Right-clicking a field now also clears only the last bind from an input field instead of clearing all of its binds.

Contributes to #2772.

Before:

Screencast_20260310_201014.webm

After:

Screencast_20260310_200821.webm

oznogon added 2 commits March 12, 2026 01:11
Add GuiScrollContainer, a subclass of GuiContainer to support
arbitrary and nested scrolling elements. This relies on changes in
SeriousProton to implement GL_SCISSOR_TEST in RenderTarget.

Child element positions and click/hover handling are translated
relative to the scroll position. These containers can be nested, and
mousewheel and scroll events are passed down the tree.

This container element can also replace the bespoke scrolling behaviors
in other element types, such as GuiListbox.

- Pass focus, text input through GuiScrollContainer.
- Position nested GuiSelector popups relative to scroll translation
- Add scrollToOffset() function to allow other elements to control
  scroll position.
- Handle layout padding in scissor rects.
- Use pragma once guard
- Internal consistency in formatting
- Expand terse varnames
- Remove redundant public/protected sections in the header
@oznogon oznogon force-pushed the refactor-hotkeymenu-hotkeybinder branch from 244bc38 to c841fe5 Compare March 12, 2026 08:13
oznogon and others added 3 commits March 12, 2026 01:44
Increase the default scrollbar click_change on GuiScrollContainer
to 50, matching mousewheel scroll increments.
Redesign HotkeyMenu to use a standardized scrolling container, and to
split binding inputs into device groups.

- Use GuiScrollContainer to make the hotkeys list vertically scrolling
  instead of horizontally paged.
- Use layout attributes for top-level GUI elements.
- Split HotkeyMenu binders into keyboard, joystick, and mouse.
- Allow binding escape control without triggering it.
- Forward-declare GUI subclasses.
- Allow binder to limit scope to mouse, keyboard, or joystick/
  gamecontroller types.
- Allow binding left/right click without immediately canceling or
  rebinding.
- Update right click to pop last bind instead of clearing all binds.
- Prevent premature clearing of binder field before input occurs.
@oznogon oznogon force-pushed the refactor-hotkeymenu-hotkeybinder branch from c841fe5 to 2f44a8d Compare March 12, 2026 08:45
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.

1 participant