0

Menu hotkeys don't work when menu is hidden

Hello,

The hotkeys(menu accelerators) don't seem to work when the menu is hidden. Is there a way around it? I implemented a (hacky)way to make them work which is to create event bindings in addition to accelerators, but the problem with that is their associated actions run twice when menu is visible! It kinda makes sense why that happens but its still not desirable.

I also tried keeping only the event bindings and removing all accelerators. That fixed the issue but also took away a neat feature which came with the accelerators - the hotkey text that is seen alongside the menu items don't appear anymore. 

Is there a good way to fix this problem?

Thanks,
Venu.

4 comments

  • Avatar
    Jon Morley Official comment

    Hi Venu,

    I jumped on that a bit early. Calling event.reject() allows other functions bound to the event to process it. So you want to make sure your method does not call event.reject() to be the only one to process it. Sorry for getting that backwards.

    Thanks,
    Jon

  • 0
    Avatar
    Jon Morley

    Hi Venu,

    Are you making sure to call event.reject() to end processing of the event? That should keep it from getting used twice. If you are then please send me your package code so I can take a closer look. Feel free to start a new private ticket in support.

    Thanks,
    Jon

  • 0
    Avatar
    Venu Krishnamurthy

    Hi Jon,

    Thanks for your reply. The callback methods did have event.reject() in them and removing it solved the problem. Yeah, the method name reject() is a bit confusing though, since it makes you think the opposite of how it works. But its good to know now.

    Thanks again!
    Venu.

  • 0
    Avatar
    Jon Morley

    Great! I am glad that did it.

Please sign in to leave a comment.