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

Home key or fn+left arrow do not move screen to start of score when a slur/tie is selected #20146

Open
zacjansheski opened this issue Nov 22, 2023 · 10 comments · May be fixed by #23093
Open

Home key or fn+left arrow do not move screen to start of score when a slur/tie is selected #20146

zacjansheski opened this issue Nov 22, 2023 · 10 comments · May be fixed by #23093
Assignees
Labels
needs review The issue needs review to set priority, fix version or change status etc. P3 Priority: Low

Comments

@zacjansheski
Copy link
Contributor

Issue type

UX/Interaction bug (incorrect behaviour)

Bug description

When a slur/tie is selected, the end or fn+right arrow takes the focus to the end of the score as expected, but home or fn+left arrow does not go to the beginnning of the score

Steps to reproduce

  1. Create a slur/tie
  2. Select the slur/tie
  3. Try to use home or fn+left arrow

Screenshots/Screen recordings

video1119601149.mp4

MuseScore Version

OS: macOS 14.1, Arch.: x86_64, MuseScore version (64-bit): 4.2.0-233260301, revision: github-musescore-musescore-acb1bad

Regression

No.

Operating system

All

Additional context

Until recently this actually caused a crash, that was fixed, but the actual functionality still needs to be fixed.

@zacjansheski zacjansheski added P3 Priority: Low and removed UX/interaction labels Nov 22, 2023
@zacjansheski zacjansheski added this to To do in Keyboard navigation and shortcuts via automation Nov 22, 2023
@cbjeukendrup
Copy link
Contributor

cbjeukendrup commented Nov 23, 2023

The source code indicates that some special behaviour is intended when pressing the home key for slurs:

if (ed.key == Key_Home && !ed.modifiers) {
if (ed.hasCurrentGrip()) {
ups(ed.curGrip).off = PointF();
renderer()->layoutItem(sl);
triggerLayout();
}
return true;
}

That looks like it is intended to reset the position of the currently selected grip, if any.

@bkunda bkunda added the needs review The issue needs review to set priority, fix version or change status etc. label Nov 24, 2023
@bkunda bkunda assigned Eism and unassigned bkunda and DmitryArefiev Nov 24, 2023
@wizofaus
Copy link
Contributor

wizofaus commented Jun 3, 2024

Happy to make this change if it's agreed what the new behaviour should be - I did a fair bit of work on this a few years back, so it's even possible something I introduced. Does 3.6 have the same problem?

@cbjeukendrup
Copy link
Contributor

3.6 works correctly. I would suggest just returning that behaviour (i.e. Home key always just scrolls to start).

We can then decide on a new, more logical, shortcut for the "reset current handle" functionality. I would propose the R key, in line with Ctrl+R for "Reset shapes and positions".

@bkunda Agree?

@cbjeukendrup cbjeukendrup assigned wizofaus and unassigned Eism Jun 3, 2024
@wizofaus
Copy link
Contributor

wizofaus commented Jun 3, 2024

There is quite a lot of code to support the Home key as a special case, even this:

bool EngravingItem::isEditAllowed(EditData& ed) const
{
    return ed.key == Key_Home;
}

bool EngravingItem::edit(EditData& ed)
{
    if (ed.key == Key_Home) {
        setOffset(PointF());
        return true;
    }
    return false;
}

which seems odd...but it strikes me that this behaviour should only occur in edit mode (much as I'd like to get rid of edit mode, we're stuck with it for now...). And the code suggests it should only kick in when a particular grip is selected...

@wizofaus
Copy link
Contributor

wizofaus commented Jun 3, 2024

Ok I just retested and Home works fine when a slur is selected. Only behaves differently if you select a specific grip - but:
a) on my keyboard (Windows laptop), this is only true for the "Home" key above Num Lock, NOT the Home on the Num. Key pad!
b) it doesn't actually reset the grip position anyway! Code definitely executes but doesn't seem to do anything.

Maybe initially reported issue is Mac-specific? In which case I can't really help sorry...

@cbjeukendrup
Copy link
Contributor

I don't think it's Mac-specific. The behaviour I'm seeing is similar to what you describe:

  • Whether scrolling works while a slur is selected seems to depend on how it was selected. When I click directly on the slur, the grip handles become visible; in that case, scrolling doesn't work. When I select the slur via Shift+drag, or by Ctrl+clicking it twice, or any way that doesn't cause the grip handles to become visible, scrolling works fine.
  • I'm not sure about numeric keypad since I don't have one.
  • Whether "Home" actually resets the handle position, seems to depend on which handle. The upper left and upper right handles do respond, but the others don't.

@wizofaus
Copy link
Contributor

wizofaus commented Jun 3, 2024

The "off" property for at least some of the handles doesn't seem to ever be used. I would think it would be quite useful to request a specific handle to be reset to its default position, but I'm not sure how feasible that is - it's not clear the information is even stored in a way that makes that possible. However I just observe something weird where it appeared to work providing I also used Home on another handle too.

Hmm, weird though, now I am able to reproduce the behaviour initially described even though no grip handle is shown as selected - and I can see how to fix that much at least.

@wizofaus
Copy link
Contributor

wizofaus commented Jun 3, 2024

Think I might have figured it out with the middle grip handle - you have to reset the offsets of the two either side.

So with my fix the new behaviour is:
Home key only resets a grip handle position IF you actually have a specific grip handle selected.
It now works for the "shoulder" grip handle, which is basically the apex of the slur. But not for the handle that is shown directly between the start/end handles, as that represents the overall slur offset. Can do that one do easily enough.

However...I also noticed that UNDO doesn't work properly when using Home key like this (it's not done via an undoable action).

wizofaus added a commit to wizofaus/MuseScore that referenced this issue Jun 5, 2024
@wizofaus wizofaus linked a pull request Jun 5, 2024 that will close this issue
8 tasks
wizofaus added a commit to wizofaus/MuseScore that referenced this issue Jun 5, 2024
wizofaus added a commit to wizofaus/MuseScore that referenced this issue Jun 5, 2024
@wizofaus
Copy link
Contributor

wizofaus commented Jun 5, 2024

Fixed Undo too. And Ties. However "home" still does nothing if the "drag" grip - which controls the overall relative position of the whole item on the score - is selected.

wizofaus added a commit to wizofaus/MuseScore that referenced this issue Jun 5, 2024
@Jojo-Schmitz
Copy link
Contributor

It is a Mu3 regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review The issue needs review to set priority, fix version or change status etc. P3 Priority: Low
Development

Successfully merging a pull request may close this issue.

8 participants