Still failing to select a menu in FINALE with modifier keys

I had a previous request about this issue that found no solution:

I noticed @peternlewis in another topic talk about software that didn't properly obey MAC modifier key behaviour:

But one of Finale's original coders has confirmed that the modifier key code in Finale does indeed interrogate the current event:

uint32_t _cocoalink_GetCurrentModifierKeys()
    const NSUInteger flags = [[NSApp currentEvent] modifierFlags];
    const FLAG_32 shiftkey = (flags & NSEventModifierFlagShift) ? __FCUserWindow::CMDMODKEY_SHIFT : 0;
    const FLAG_32 fnkey = (flags & NSEventModifierFlagFunction) ? __FCUserWindow::CMDMODKEY_FUNCTION : 0;
    const FLAG_32 altkey = (flags & NSEventModifierFlagOption) ? __FCUserWindow::CMDMODKEY_ALT : 0;
    const FLAG_32 ctrlkey = (flags & NSEventModifierFlagControl) ? __FCUserWindow::CMDMODKEY_CTRL : 0;
    const FLAG_32 cmdkey = (flags & NSEventModifierFlagCommand) ? __FCUserWindow::CMDMODKEY_COMMAND : 0;
    return shiftkey | fnkey | altkey | ctrlkey | cmdkey;

Having tried everything we could imagine from my first post, can anybody guess at why Finale software can correctly identify key modifiers with a menu item selected manually with a mouse, but can't detect them when a menu is selected with KM?

How are you selecting the menu?

The Select a Menu Item action selects the menu via the accessibility API. So there may not even be a real “current event” at that point to process, since the accessibility API is not part of the event queue. If so, then Finale’s behaviour has accessibility implications which they may want to think about.

That said, the only options I can suggest are:


or, desperation

If none of them work, then I'm out of ideas.

Thank you for such a quick, thorough and thoughtful reply!

Had already tried the first option and the other two sadly also don't work. I'll keep pondering, but if you can't think of a fourth solution then I doubt anybody can!

I thought this might interest you, @peternlewis.

I revisited this issue (urged by the veteran Finale scripter) and your 3rd option WORKS! Turns out that Finale needs a MOUSE-UP WITH MODIFIER event, at least to pass modifier key information through to the plug-in (via PDK) with a menu. Several methods work to get to the required sub-menu item, but there must be a click on that sub-menu followed by a RELEASE with modifier.

This will be valuable information to a small band of dedicated Finale users who use KM for all their GUI needs. I've attached a pic of the macro and the macro itself - customised for one of my tasks.

Finale OPTION click menu.kmmacros (73.3 KB)

1 Like