Command-H menu select

I have assigned Command-H to select a menu item in my app.

On Mac, when I type Command-H, the application window disappears. I have return true at the end of the menu handler. The handler never fires.

How do I stop this stupid behaviour?

I just discovered, the Command-H keyboard shortcut doesn’t even show up in the menu, no wonder the handler doesn’t fire. There seems to be no way to assign Command-H as a shortcut.

I think that’s because Command-H is already spoken for in your macOS App menu. I assume this is an automatic assignment for all macOS Desktop apps.

For example, under the Xojo app menu you’ll see it as well as any Desktop app you create in Xojo (at least in mine they automatically appear, without me doing anything).

I hope that helps.

Thanks, Scott. You are correct. I had not seen that.

Is there no way to stop that menu item from appearing under the application menu?

Not as far as I know.

You can add custom menu options to that menu list using ApplicationMenuItem.

But I suppose if you could access the top “MyApp.debug” MenuItem somehow, you might be able to walk down the list and maybe remove some items using RemoveMenuAt.

Do you want to fight against the OS ?

Along the years, this happened to me too, I changed my mind and choosed a different one.

Be creative, use one that is not OS reserved