Cmd-. beep?

I would like in my app also to terminate it with Cmd-.
In the window key-down handler, I ask for Escape, and it works.
And also for “.”, and if keyboard-OSkey is pressed: but then the app (Xojo? Finder?) just a beeps, it never gets into the key-down handler (breakpoint not triggered)…
What is going on?

Some controls handle keydown events themselves and don’t pass them up to the window keydown. It is possible that the control that has focus is causing the beep.

Mhh, it’s a simple window with a group box and labels and just one Quit pushbutton, and drop object enabled. No Textfield, Listbox, or Radiobutton to get control or focus.

Not sure about this but in a listbox you can bypass the beep (when clicking on a cell) by return true in the event. Maybe the same can be applied here.

Well, all I try to do is after the application started and the window is open, to quit it with Cmd-. (No clicking or selecting)
All I get is a beep… (and with Escape it works).

Cmd-. is cancel and not quit.

You are right, Beatrix, it’s a bit misused. Look at it in this case as canceling the starting of the application… But shouldn’t it work nevertheless? It does in other applications, strangely…! I’m looking here for proactive help, like ‘you should set this or that’ in the window or app definitions, or check this forum thread xy, or is it a Xojo bug?

I have a menu handler with Cmd-. as key combo. That works 100%.

Yes, that’s a good idea. I’ve implemented it just now and it works. Thanks, Beatrix.
So, although I still don’t know want the problem is, I found a quick work-around.