Cannot type Z in Mixer

• Jun 4, 2018 - 16:29
Reported version
2.1
Type
Graphical (UI)
Severity
S4 - Minor
Status
active
Project

Related to #270021: Problem typing letter "p" in system text?

Since at least version 2.1, when you use the keyboard in the mixer to type the first few letters of a sound, you cannot type Z. If you do you will get the Master Palette. It seems the P was thought of for the Piano keyboard, but the Z was forgotten.


Comments

Isn't Shift+F9 the shortcut for the master palette? Z is for the symbols palette. And indeed that shows here.
I don't get why though, can't see the relevant diff between how P and Z are handled.

Except: there doesn't seem to be any match for Z in the list of sounds, but there is for P

In reply to by Jojo-Schmitz

Shift+F9 and Z display the exact same popup. Both say Master Palette in the title bar and both default to the symbols section of the master palette. Shift+F9 remembers if changed to a different section of the master palette and opens in that section the next time.

True indeed...
When pressing Z, what Instrument/sound do you expect to show?
My suspicion is that just because there is no match for the Z, that key gets passed on to the shortcut.

Hmm. I remember doing some investigation of a similar issue a few months ago and finding there was different in how the shortcuts were defined - application context versus window context, something like that - and seeing there were two specific shortcuts that seemed "off". I can't find that discussion now, as I don't remember enough details to put together a reasonable search. Maybe that rings a bell for someone else?

Shortcut for Piano Tool is set up up in shortcut.cpp, lines 2691-2697, the shortcut for the symbols palette at lines 2923-2932
Code:

      {
         MsWidget::MAIN_WINDOW,
         STATE_NORMAL | STATE_NOTE_ENTRY | STATE_PLAY | STATE_FOTO | STATE_EDIT,
         "toggle-piano",
         QT_TRANSLATE_NOOP("action","Piano Keyboard"),
         QT_TRANSLATE_NOOP("action","Piano keyboard")
         },

vs.

      {
         MsWidget::MAIN_WINDOW,
         STATE_NORMAL | STATE_NOTE_ENTRY,
         "symbols",
         QT_TRANSLATE_NOOP("action","Symbols..."),
         QT_TRANSLATE_NOOP("action","Show symbol palette"),
         0,
         Icons::Invalid_ICON,
         Qt::ApplicationShortcut
         },

I've tested and that Qt::ApplicationShortcut (vs. the default of Qt::WindowShortcut) is the relevant difference. Not sure whether we can simply change that?

See also http://doc.qt.io/qt-5/qt.html#ShortcutContext-enum

That change to Qt::ApplicationShortcut came in with 81ad1b4b9d fo fix #43296: Shortcuts for key signature, time signature, and symbols palettes not working

In reply to by Jojo-Schmitz

As far as which sound, you can quickly type the first few letters of a sound and the mixer will look for a sound starting with that group of letters. I discovered this typing "piz" to navigate a few sound fonts I have loaded so I could find good sounds for stringed instruments playing pizzicato.

I see that was my change, but I don't see from the comments that making it QtApplicationShortcut was actually relevant - I may have just copied and pasted that from elsewhere. Worth checking to see if removing that fixes the current problem without breaking the original fix.

FWIW, another way to check on the "Z" behavior would be to customize the shortcut to "T". If not for the bug, this would set the dropdown to "Tine Electric Piano", but it doesn't - it brings up Symbols, just as Z does. But the fact that it also fails on the "Z" in "piz" is just as good :-)