V4 released!

 From:  mkdm
10083.130 In reply to 10083.129 
Thanks Michael for your tip.

But...no, I'm sorry, It doesn't work properly.

let me explain...

If I use your suggested "OnKeyDownEvent" and I open the popup as a DIALOG, ok, it works.
But ONLY for single keystrokes.
But most of my shortcuts are a combination of a key and qualifiers, and if I use OnKeyDownEvent, as soon as I press a qualifier, the dialog closes.

So I've tried the OnKeyUpEvent instead.

But, if open the popup ad DIALOG, it immediately gets the focus, and while I'm releasing the A key (that opens the dialog) it automatically closes.

SO, I'VE FOUND THIS PARTIAL SOLUTION:

I open the popup NOT as a dialog BUT as a MENU with showMenu(...) and I use the OnKeyUpEvent so I can handle the shortcuts that are combination of a key and qualifiers.
And all works fine :)

But now I only would need that the popup menu could gets automatically the FOCUS as soon it open.
Because if I don't first click inside it, but only press any of the keyboard shortcuts, the related command starts, but the popup menu doesn't close.
Instead, if I first click inside it, then when I press a keyboard shortcut, the popup menu close correctly.




Thanks for your help.