Scope of plugin shortcuts

• Feb 1, 2022 - 12:52

Hello,

I wrote my own "toggle visibility" plugin, so I removed the shortcut for that action in preferences->shortcuts, and defined V as the shortcut for my plugin.

That works, but when I'm entering text, I can't type the letter 'v' anymore.

So musescore is treating shortcuts differently. Is there a method to set the 'scope' of a shortcut?
And if not, is there a method to find out if you are in 'text mode' and if so, is it possible to insert
a letter at the text cursor's position? If so, I can do this in my plugin.
It would hardcode the shortcut in my plugin code, which is kind of ugly, but I can live with that.

Thanks,
Luc.

PS. I know I can choose a key-combination that isn't used in text as shortcut, so that's not the issue :-).


Comments

I believe the plugin assigned shortcuts are hardcoded as "Application Wide".

Not sure whether you can "catch and forward" the keypress; I'm assuming you perhaps could get the text edit state derived from scoreStateChanged but it could be that this is only triggered after the text input is completed.

Do you still have an unanswered question? Please log in first to post your question.