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

fix #302822: breaks are now accessible via keyboard #5919

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

SKefalidis
Copy link
Contributor

Resolves: https://musescore.org/en/node/302822

Added the ability to access breaks via the keyboard.

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • [n\a] I created the test (mtest, vtest, script test) to verify the changes I made

@@ -641,6 +641,9 @@ Element* Score::nextElement()
return mb;
}
}
case ElementType::LAYOUT_BREAK: {
staffId = 0; // otherwise it will equal -1, which breaks the navigation
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this do reasonable things if the top staff happens to be invisible or hidden? To be honest, it's not clear what the expectation is here, and I actually tried it a few different ways when implementing navigation through frames or through repeat text, both of which also don't necessarily have a valid staffid of their own.

Copy link
Contributor Author

@SKefalidis SKefalidis Apr 9, 2020

Choose a reason for hiding this comment

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

I hadn't thought of that possibility. Unfortunately, it does not do reasonable things if the top staff is hidden (if I was a user I would expect the top visible staff to lead me to the break).

Fortunately, it does allow for a more reasonable workaround (the user can alt+up to the invisible top staff, change the break and go down again). I will continue looking into this issue (see if I can make it behave in a smarter manner).

At the very least, this behavior seems consistent with the current behavior of similar elements :^).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, then to me, that does count as "reasonable" :-). I tried having other measure elements act the way you describe - navigating as if they were attached to the top visible staff - but it turned out to be more trouble to get right than it was worth, in my opinion.

I'm OK with the break still navigating on the top staff even though it isn't visible, because actually, a blind user currently gets no feedback whatsoever about what is visible and what isn't. So they would not normally know or think to not navigate the top staff just because it doesn't happen to be visible on the current system.

Someday it will make sense to have the screen reader announce when you are on a staff that is not visible.

Anyhow, I built this code and it does seem to work well, but I couldn't easily test the various cases I'd have wanted to because on my system right now the Instruments dialog crashes MuseScore - and my whole system - hard. Not sure what's up with that, but it's not connected to your code of course.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarcSabatella have you found a way to fix your machine? Do you have time to test the changes from this PR?

Copy link
Contributor

@MarcSabatella MarcSabatella Apr 15, 2020

Choose a reason for hiding this comment

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

I got some things working better, but instruments dialog still crashes for me. I will try on my Windows machine, though.

@MarcSabatella
Copy link
Contributor

I have now been able to test this in a variety of scenarios involving multiple staves, hidden staves, etc, and all is well. I guess a slight improvement possible would be to override and augment the accessibleInfo() for the breaks to say which kind of break they are - system, page, or section. Maybe similar to how other elements implement a userName() function that is then used in their accessibleInfo(). This would add new strings for translation, I guess, although they are duplicates of strings used elsewhere (eg, in menus.cpp). Anyhow, not as important as getting the navigation itself working, so to me it can wait for another PR.

@anatoly-os anatoly-os merged commit 2d2027e into musescore:master Apr 20, 2020
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.

4 participants