MuseScore icon indicating copy to clipboard operation
MuseScore copied to clipboard

Fix "Advance cursor" shortcuts for figured bass/chord symbols

Open cbjeukendrup opened this issue 3 years ago • 7 comments

Resolves: #14916

Problem was that TextBase::isEditAllowed returned "true" way too often; even for shortcuts that it doesn't handle at all. Therefore, these shortcuts are blocked from going through the normal shortcuts/actions system, which prevents the corresponding actions from working.

For testing: We basically need to make sure that every possible shortcut you might want to use in text edit mode works. And that needs to be done for every text type: lyrics, chord symbols, figured bass, fingering, sticking, but also normal staff texts and text boxes.

I discussed this with @vpereverzev today; probably, it won't be suitable for the rc branch, as this is quite a risky change since it feels like this whole TextBase / "editing" stuff is a bit of a mess.

cbjeukendrup avatar Dec 09 '22 18:12 cbjeukendrup

I checked this PR and doesnt seem to work for Figured bass, nor Chords.

It brings also new issue - ESC doesnt work in Lyrics, in Chords, in Text, in Figured Bass.

https://user-images.githubusercontent.com/1646034/206876194-87284553-4db8-4d64-b2c0-ede5eda4d40c.mp4

Linux Ubuntu Studio 22.04

sammik avatar Dec 10 '22 21:12 sammik

@sammik Strange... on Mac, it works well now. I'll try on Windows, to see if it's indeed still broken on non-Mac.

I could reproduce the Esc problem though; that should be fixed now.

cbjeukendrup avatar Dec 11 '22 01:12 cbjeukendrup

@sammik Strange... on Mac, it works well now. I'll try on Windows, to see if it's indeed still broken on non-Mac.

I could reproduce the Esc problem though; that should be fixed now.

I checked win. ~It seems, that numpad doesnt work now also for duration in note entry.~ EDIT: NumPad doesnt work in win also in nigthly, si this is not related.

Duration in Figured bass doesnt work for me (I checked both numpad, and standard numbers).

sammik avatar Dec 11 '22 15:12 sammik

As far as I know from dozens of reports, numpad doesn't work period in MU4, on any system, for anything. I don't have a numpad to test myself.

MarcSabatella avatar Dec 11 '22 17:12 MarcSabatella

@cbjeukendrup Tested on Win10/Mac13 - it works on Mac but DOESN'T WORK on Windows

DmitryArefiev avatar Dec 26 '22 11:12 DmitryArefiev

Yeah, this wasn't quite ready for testing, as found in the comments above... Sorry, I didn't know you were already assigned, otherwise I would have unassigned you :)

cbjeukendrup avatar Dec 26 '22 15:12 cbjeukendrup

Yeah, this wasn't quite ready for testing, as found in the comments above... Sorry, I didn't know you were already assigned, otherwise I would have unassigned you :)

OK. No problem :)

DmitryArefiev avatar Dec 26 '22 17:12 DmitryArefiev

Now it should finally be fixed on Windows too!

cbjeukendrup avatar Dec 28 '22 00:12 cbjeukendrup

Now it should finally be fixed on Windows too!

Yes, now it looks fine on Windows and Linux too!

DmitryArefiev avatar Dec 28 '22 10:12 DmitryArefiev

Tested #14916 on Win10, Mac12, LinuxMint 22.04 - FIXED

DmitryArefiev avatar Dec 28 '22 11:12 DmitryArefiev

Unfortunately, now Ctrl+Right is broken - it's meant to navigate from measure to measure. It worked (for me and most people anyhow - a few reports of issues on Mac) in 4.0.0, but it no longer does in master. It still functions to navigate words within ordinary text, but its special behavior for chord symbols is now gone.

It's worth mentioning that in the past, it was always Tab to navigate measures, and we are already getting a ton of complaints about this having changed. Although I understand that Tab is normally meant to be reserved for navigating a user interface, I still question whether that makes sense here. After all, text editing applications obviously use Tab for its original purpose of actually moving to the next tab stop within a document, so it can't be an ironclad rule that Tab must navigate the UI.

So I'd still vote to restore Tab/Shift+tab for measure navigation, but failing that, Ctrl+Right/Left needs to be reinstated.

MarcSabatella avatar Jan 03 '23 22:01 MarcSabatella

FWIW, also see https://github.com/musescore/MuseScore/issues/13148. Alt+Left/Right is meant to provide note-to-note navigation between staff texts. I assume that code is still present somewhere but isn't being hit. Also see https://github.com/musescore/MuseScore/issues/15156. Ctrl+B and Ctrl+I are broken too. Neither of these are new regressions since this PR, but it seems the code in this PR is probably relevant to any fix.

MarcSabatella avatar Jan 03 '23 22:01 MarcSabatella

@cbjeukendrup Looking over the code changes here and thinking through what is going on, I definitely agree a major overhaul someday would be nice. But for now, I'd be happy with a "bandaid" fix for the specific issues I see:

  1. Ctrl+Left/Right not working in chord symbols or figured bass (should move to next/previous measure) - that's a regression from 4.0.2
  2. Ctrl+Underscore doesn't work in lyrics (should insert underscore) - regression from MU3 but not working in 4.0.2 either
  3. Alt+Left/Right not working for staff text (should work like Space in fingering) - regression from MU3 but not working in 4.0.2 either

For 1), I think the best places to fix this would be in Harmony::isEditAllowed() and FiguredBass::isEditAllowed(). In 4.0.2 I guess it must have worked because Ctrl+Left/Right was being detected by isTextNavigationKey() but isn't anymore, and adding that back feels like a step backwards, so special casing it in Harmony & FiguredBass is my vote. I'm happy to try a PR for this, unless you'd rather.

For 2), I'm really at a loss; I have no idea where that is supposed to be handled. Presumably the same place Ctrl+Minus gets handled to insert a hyphen, but I can't even find that.

For 3), I wrote the original code for this in MU3 but too much has changed for me to say how to best address it. I was hooking into the next-element and prev-element handlers but that's more complicated now. I think maybe the most logical place to reproduce the functionality is https://github.com/musescore/MuseScore/blob/5cda56428e423623e7330de4ef08f686c286c853/src/notation/internal/notationinteraction.cpp#L2661

The necessary support code seems intact, it's textTab() and is being used successfully by fingering. Here's how it was done in MU3 - https://github.com/musescore/MuseScore/pull/4521/files#diff-3e7cf0f7e03151067c94f814562f7c5abcca42c7cf729ec8dd10991e0935ce84

MarcSabatella avatar May 01 '23 22:05 MarcSabatella