As a safety measure I’d like to add an escape route for an onHide method used with a FormAsDialog. Ordinarily I want to deny the user from using the close button on the dialogue. But while in development and possibly if the end user gets hung up and panics, I’d like to have a key combination which will close the form.
The following code works detects the Shift-Alt combination except when used in the FormAsDialog context.
//shift + alt(option) is pressed, emergency escape.
var m = application.getLastKeyModifiers();
if ((m & 9) == 9)
{
return true;
}
else
{
if (!globals.gflag)
{
plugins.dialogs.showErrorDialog('Error','<html>Please fill in all available information
and use the buttons provided to close this dialogue.')
return false;
}
else
{
globals.gflag = null;
}
}