Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow seek to next/previous object via keybinding if there is no selection #29860

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Sep 13, 2024

RFC. Closes #29803. cc/ @OliBomby.

New default is Ctrl-Alt-/ (in other words, Alt was added).

Passes tests so hopefully fine. Our code is notoriously ungreppable for this sort of thing. Additionally features extended test coverage for both clashing features which was not there.

@peppy
Copy link
Sponsor Member

peppy commented Sep 13, 2024

Thoughts on making nudging position use ctrl-alt instead? To me it feels like a rarer operation so I'd prefer it was less accessible.

Reason for not doing this is to match stable expectations, I guess.

@OliBomby
Copy link
Contributor

I'm a bit worried about the keybinds for nudging selection and seeking interfering in the first place, because this is limiting the available keybinds for selection as well. We already have to resort to quite complex modifier combinations for simple actions.

We might want to change logic so it prioritizes keybinds for selection (nudging) whenever there is a selection, and do the more global keybinds (seeking) only if there is no selection or it is not handled by the selection. This way the hotkeys could be more context-aware in a sense.

@peppy
Copy link
Sponsor Member

peppy commented Sep 13, 2024

Contextually aware was also something I thought about. We could give it a try and see how it feels, for sure.

@bdach
Copy link
Collaborator Author

bdach commented Sep 13, 2024

We might want to change logic so it prioritizes keybinds for selection (nudging) whenever there is a selection, and do the more global keybinds (seeking) only if there is no selection or it is not handled by the selection. This way the hotkeys could be more context-aware in a sense.

I considered it but I dunno if we want to go there because it's putting layers upon layers again. If you both think that's worth a go then sure.

@pull-request-size pull-request-size bot added size/M and removed size/L labels Sep 13, 2024
@bdach bdach changed the title Change default keybinding for seeking to previous/next objects to avoid clash with nudge hotkeys Only allow seek to next/previous object via keybinding if there is no selection Sep 13, 2024
@@ -721,10 +721,16 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
switch (e.Action)
{
case GlobalAction.EditorSeekToPreviousHitObject:
if (editorBeatmap.SelectedHitObjects.Any())
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no way to catch if any event has already been handled by a selection? It'd be nice if this could leverage the input handling system in some way to handle this in a general way instead of making all these a conditionals.

Also I think it should be able to seek while there is a selection if you have bound the seek key to some unused key, which in this implementation is not possible.

Copy link
Collaborator Author

@bdach bdach Sep 13, 2024

Choose a reason for hiding this comment

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

Is there no way to catch if any event has already been handled by a selection

No. Or at least no sane way.

Also I think it should be able to seek while there is a selection if you have bound the seek key to some unused key

I refuse to do such checks because it's weird and means that we have failed and made everything too customisable. Now things work or don't work depending on how users' bindings are set up. I am not willing to be on the hook for diagnosing weird failure modes like that.

Copy link
Contributor

@OliBomby OliBomby Sep 13, 2024

Choose a reason for hiding this comment

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

I don't see how more customisability amounts to a 'fail'. More customisability is often better.
I guess most of your issue lies with the implementation of my suggestion as it would probably be a pain.

Current implementation is still weird because this context awareness is only on the hitobject seek while there is none for the other seek types. The only distinction between the seek types is that the hitobject seek is a formerly conflicting keybind.
To me a makes a lot more sense if all the seek keybinds adhere to the same rules:

  • No conflicted keybind -> works in all contexts
  • Conflicted keybind -> only works if there is no selection

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To me a makes a lot more sense if all the seek keybinds adhere to the same rules:

  • No conflicted keybind -> works in all contexts
  • Conflicted keybind -> only works if there is no selection

No I do not accept this premise. Doing this is a failure of design.

There are two options:

  • You make things customisable but also make sure to put enough guardrails to ensure the user can't shoot their foot off with the customisation options.
  • You don't make things customisable at all.

I'm not having this halfway "you make things customisable but by doing so you allow other features to silently change behaviour for no observable reason" you're proposing here. If you insist you can try implementing it yourself but I will not put my hand to it by either trying to implement this or approving it during review.

@bdach bdach added the next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! label Sep 23, 2024
@bdach bdach self-assigned this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editor next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! size/M type:input
Projects
Status: In Review
3 participants