Close modeless form by ESC key

Started by Juerg W. Menzi, June 10, 2010, 12:00:09 AM

Previous topic - Next topic

Juerg W. Menzi

Hi all

Probably I've a hole in my brain... ;D
but how to close a modeless dialogue by ESC key if the dialogue has no focus?

Cheers

owenwengerd

The window with keybard input focus decides how to respond to the [Esc] key.  If that window is the AutoCAD command line, there are probably ways to translate [Esc] into a (dcl_Form_Close) call, but offhand I don't know what would be the best way to do that.
Owen Wengerd (Outside The Box) / ManuSoft

Juerg W. Menzi

Hi Owen

Thanks for the answer - seems to be a disadvantage of modeless dialogues.

Meanwhile I use a (partial) solution with a command reactor. If the user invokes an unused command (he needs only Zoom, Pan etc. during the modeless dialogue), the dialogue will be closed by this reactor - not perfect but usable.
It would be fine if AutoCAD would offer something like a KeyPressed reactor... 8)

Cheers

jmaeding

it seems like you would only want a modeless to close when doing something involving it.
If you draw a line, and hit escape, you do not want some dialog to close.
If you are running a command like "change color", and you has a modeless dialog with colors, then you could program in code to close that dialog if the user hits escape during the command.
I'm a bit surprised you want to close dialogs outside of commands that involve them.
maybe you want to close them during things like zoom and pan, but that will be very annoying to people suring the commands that do need them.
Can you explain a bit more what you are doing?

Juerg W. Menzi

Hi James

The only thing to use a modeless dialogue was to allow the user using zoom, pan, etc. during the dialogue. The first idea was to close the dialogue by ESC key, but no solution available. This was the reason to use a command reactor for close the dialogue if the user starts another command than zoom, pan, etc.

Cheers