Menu keyboard shortcut not working


I have DesktopMenuItem, whose shortcut is not working. If I click on it works, but the keyboard shortcut is grayed out, as in the attachment. What could it be?


Screenshot 2023-06-11 alle 19.21.02

Probably because command R is used by other programs.
Command R is commonly used for refresh, for example in Safari and App Store.
It is better to use a different shortcut for your Rotate Board.

Thank you for the answer but it seems not to be that. I tried with Shift + Cmd + B and same result…

Screenshot 2023-06-12 alle 08.02.32

Sorry man, but for Cmd-R: MacOS use it.

For the other one, is it in WIndow1 ?
If you added a window and try to call a MenuItem from it, you must assign the MenuBar to that window (not done by default on added windows…)

If this is not the case, you have to explain how you set the keyboard shortcut…

Yes the menubar is assigned to the main window. Regarding on how I defined it, I used the interface as in the attachment below. Any ideas on what I am doing wrong?

Did you add a new MenuEvent Handler for this MenuItem ?

Yes and indeed it works if I click it with the mouse. The problem is the shortcut. I cannot really figure out what I am missing. Thanks.

Screenshot 2023-06-12 alle 12.57.11

FWIW, keyboard shortcuts always appear grayed out in Ventura. I’m not sure whose idea that was, but I had the same thought as you when I first installed it… that they must not be active, but it’s not the cause of your trouble.

I notice in your screenshot that you used a lowercase “b”. Try that with a “B” and see if it helps.

I do not noticed that !!!

For the LowerCase b, I noticed, but not tested to check how Ventura react…

LowerCase b appears as UpperCase B in the menu and works (here, MacBookPro m1).

Are-you sure you do not already have an empy Event Handler (in App) with that Keyboard Shortcut that do nothing (excepted Return True) ?

I’m still running BigSur and it’s a few years since I noticed the gryed out keyboard shortcuts. Yes, I very cute idea; may be too much cute.

I started a new project from scratch, copying all classes and controls over the new one and so far it is working (even CMD + R works). So, maybe I corrupted something in the previous project. Strange though…

Thanks for the help

Shortcuts of other apps won’t interfere with ones inside your app, unless they are global on the system (which Command-R aren’t). There’s no fight here.

For this to conflict, it would have to be Davide’s own app’s file menu. I bet you don’t know whether it has “Show original” there.

1 Like

Apparently, I was wrong.

Here’s an Apple document on the subject: