They were added in order to fix #23473: Notes and rests shorter than 128th do not display or copy properly and #227826: Regression: In any Text-area, you are prevented from using the (Del) key.. Their purpose is to disable the augmentation dot and delete commands in order to allow the period and the delete key to be used for text editing, and to enable the commands when not editing text. The reason the double dot button remains disabled is because "pad-dot-dot" is a misspelling of "pad-dotdot". It was probably included for completeness, but this was before "pad-dot3" and "pad-dot4" were added. The "pad-dotdot" command does not even have a default shortcut key.
These lines no longer seem to be necessary, at least on macOS, and when the delete key is the backspace key. But in case they are still necessary for other environments, they can be changed to this:
Yes, I got it. But I still don't understand how these two cases are connected. And how changes in dotdot argument can change the initial scenario. I think it is because today is Saturday and I had 12 hours work day :)
The double dot was not affected because of the typo. Correcting the typo would cause it to be affected, if not for the change in the second line. Checking for STATE_PLAY is what really fixes the issue.
After looking at this some more, I am convinced that these two lines can be removed. Without them, the final else clause will be executed, which will do the right thing in all cases that were not handled earlier. "pad-dot", "pad-dotdot", and "delete" are only valid in STATE_NORMAL and STATE_NOTE_ENTRY, as defined in mscore/shortcut.cpp. Thus, for these shortcuts, s->state() evaluates to (STATE_NORMAL | STATE_NOTE_ENTRY), and so (s->state() & val) will be considered true when changing to STATE_NORMAL or STATE_ENTRY_MODE, and false otherwise. Therefore, these commands will be enabled when they are supposed to be enabled, and disabled when they are supposed to be disabled, without special handling.
Comments
These lines in MuseScore::changeState() in mscore/musescore.cpp are responsible for enabling the augmentation dot:
else if (s->key() == "pad-dot" || s->key() == "pad-dot-dot" || s->key() == "delete")
a->setEnabled(!(val & (STATE_ALLTEXTUAL_EDIT | STATE_EDIT)));
They were added in order to fix #23473: Notes and rests shorter than 128th do not display or copy properly and #227826: Regression: In any Text-area, you are prevented from using the (Del) key.. Their purpose is to disable the augmentation dot and delete commands in order to allow the period and the delete key to be used for text editing, and to enable the commands when not editing text. The reason the double dot button remains disabled is because "pad-dot-dot" is a misspelling of "pad-dotdot". It was probably included for completeness, but this was before "pad-dot3" and "pad-dot4" were added. The "pad-dotdot" command does not even have a default shortcut key.
These lines no longer seem to be necessary, at least on macOS, and when the delete key is the backspace key. But in case they are still necessary for other environments, they can be changed to this:
else if (s->key() == "pad-dot" || s->key() == "pad-dotdot" || s->key() == "delete")
a->setEnabled(!(val & (STATE_ALLTEXTUAL_EDIT | STATE_EDIT | STATE_PLAY)));
Thank you for deep research, Matt! The initial topic was about single dot button in a bit other case :)
In case I wasn't clear in my earlier comment, the change that I suggested fixes this issue.
In reply to In case I wasn't clear in my… by mattmcclinch
Yes, I got it. But I still don't understand how these two cases are connected. And how changes in dotdot argument can change the initial scenario. I think it is because today is Saturday and I had 12 hours work day :)
The double dot was not affected because of the typo. Correcting the typo would cause it to be affected, if not for the change in the second line. Checking for STATE_PLAY is what really fixes the issue.
Ah, lol, didn't catch this change. Thank you again!
After looking at this some more, I am convinced that these two lines can be removed. Without them, the final else clause will be executed, which will do the right thing in all cases that were not handled earlier. "pad-dot", "pad-dotdot", and "delete" are only valid in STATE_NORMAL and STATE_NOTE_ENTRY, as defined in mscore/shortcut.cpp. Thus, for these shortcuts, s->state() evaluates to (STATE_NORMAL | STATE_NOTE_ENTRY), and so (s->state() & val) will be considered true when changing to STATE_NORMAL or STATE_ENTRY_MODE, and false otherwise. Therefore, these commands will be enabled when they are supposed to be enabled, and disabled when they are supposed to be disabled, without special handling.
See https://github.com/musescore/MuseScore/pull/3780
Fixed in branch master, commit 41cb77a5f8
fix #273606: Augmentation dot issue
Remove excessive statement in MuseScore::changeState(ScoreState val)
Fixed in branch master, commit d95727bfcf
Merge pull request #3780 from handrok/Augmentation-dot-issue
fix #273606: Augmentation dot button is not disabled
Automatically closed -- issue fixed for 2 weeks with no activity.
This is still an issue in 2.3.2, and the solution is the same as it was for master.
Not applied to 2.3.2.
Automatically closed -- issue fixed for 2 weeks with no activity.