Name: interrupt

Type: function

Syntax: the interrupt

Syntax: interrupt()

Summary: <return|Returns> true if the <allowInterrupts> <property> is false and the user has attempted to halt the current <handler> with a <key combination>.

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
if the interrupt then doCleanExit

Returns (bool): The <interrupt> <function> <return|returns> true or false.

Description:
Use the <interrupt> <function> within a <handler> to check whether the user has attempted to stop the <handler> by typing Control-period or Control-break (on <Windows> or <Unix>) or Command-period (on <Mac OS>).

Normally, pressing one of the key combinations stops any running handlers. If the <allowInterrupts> <property> is set to false, the user cannot interrupt a <handler> in this way.

To let the user interrupt a handler when the <allowInterrupts> is false, check the <interrupt> <function> periodically. If it <return|returns> true, the user has attempted to stop the handler. You can then perform any needed cleanup tasks before <exit|exiting> the <handler>.

References: allowInterrupts (property), lockErrorDialogs (property), errorDialog (message), function (control_st), property (glossary), return (glossary), key combination (glossary), handler (glossary), Windows (glossary), exit (glossary), Mac OS (glossary), Unix (glossary)

Tags: ui
