Using the getLastKeyModifier() function

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;
	}
}

what kind of close button are you referring to?
The in the titlebar?

Or do you have an own close button on the form?
This last one i just tested and it works fine in the test i made. Youre piece of code does catch when i presse the button on the form with ALT-SHIFT pressed in.