Skip to content

Fix song select navigation with page up/down#36293

Merged
peppy merged 3 commits intoppy:masterfrom
linusgenz:36099-song-select-with-page-keys
Mar 1, 2026
Merged

Fix song select navigation with page up/down#36293
peppy merged 3 commits intoppy:masterfrom
linusgenz:36099-song-select-with-page-keys

Conversation

@linusgenz
Copy link
Copy Markdown
Contributor

@linusgenz linusgenz commented Jan 10, 2026

Resolves #36099

This PR fixes keyboard navigation in the beatmap select carousel for lazer by implementing page-wise traversal with the Page Up and Page Down keys and changing it from only scrolling to actually selecting items.

Changes:

  • Added handling for TraversalType.Page in the keyboard traversal switch.
  • Implemented traverseKeyboardPage(int direction) method to move the selection by approximately one "page" of visible items, accounting for partially obscured items like the search bar. Also it does not wrap around (like the current PageUp/Down functionality).
  • Added new key bindings:
    • PageUp → SelectPreviousPage
    • PageDown → SelectNextPage

The code may be very explicit for the scroll logic with the page keys, so I would appreciate some feedback when the PR is reviewed.
The naming of the keybinds may need to be adjusted. Next page and previous page may be somewhat misleading.

Behavior after the change:

  • Pressing Page Up/Down now moves the selection by a page of items.
  • After navigating, pressing Left/Right selects the navigated song instead of moving relative to the previous position.

See:
https://www.youtube.com/watch?v=JXmKAhhKiCc

Signed-off-by: Linus Genz <linuslinuxgenz@gmail.com>
@peppy
Copy link
Copy Markdown
Member

peppy commented Jan 12, 2026

Duplicate of #36305. Only one of these two should be merged.

@nagi-desuuu
Copy link
Copy Markdown

Now supersedes #36305

@peppy peppy self-requested a review March 1, 2026 14:08
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.SelectNext))]
SelectNext,

[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.SelectPreviousPage))]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't think of a case someone would want to customise this. Let's just code it local to song select as pageup/pagedown?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also you missed the comment on the enum where what you've done here will break the game very obviously. Running the game will immediately show the breakage of hotkeys.

new KeyBinding(InputKey.Up, GlobalAction.SelectPrevious),
new KeyBinding(InputKey.Down, GlobalAction.SelectNext),

new KeyBinding(InputKey.PageUp, GlobalAction.SelectPreviousPage),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are in global but only ever used for song select which is misleading. In addition, if you change the bindings, page up and page down will now perform different behaviour but still work.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 1, 2026
@peppy peppy force-pushed the 36099-song-select-with-page-keys branch from 12fa234 to de8d47f Compare March 1, 2026 15:47
@peppy
Copy link
Copy Markdown
Member

peppy commented Mar 1, 2026

Applied required changes myself.

@peppy peppy merged commit 033e13c into ppy:master Mar 1, 2026
8 checks passed
Rudicito added a commit to Rudicito/osu that referenced this pull request Mar 7, 2026
It's a continuation of ppy#36293, but for home and end keys.
peppy pushed a commit that referenced this pull request Mar 10, 2026
It's a continuation of #36293, but for
the home and end keys.

Now when using home or end keys, it selects respectively the first or
last item in the carousel, instead of just scrolling.

## Before: 


https://github.com/user-attachments/assets/6ab08d2f-1da4-4740-9d9e-574d7a8a10c9

## After:


https://github.com/user-attachments/assets/30bab836-0006-4830-b4e9-2d85017a15e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigating song select in lazer with page up/down key is different than stable/legacy osu

3 participants