Livecode Wiki
Advertisement

A Message sent when the user presses the key combination equivalent to the "Undo" menu item. If there is a message handler by the same name in the message path, then it will be executed.

Message[]

Syntax:

undoKey

The message is sent to the active (focused) control, or to the current card if no control is focused.

The LiveCode development environment traps the undoKey message, unless "Suspend LiveCode UI" is turned on in the Development menu. This means that the undoKey message is not received by a stack if it's running in the development environment.

The undoKey message is sent when the user presses Command-Z (on Mac OS|Mac OS systems), Control-Z (on Windows systems), Alt-Backspace (on Unix systems), or the keyboard Undo key.

Message handler[]

Examples:

on undoKey
  if the optionKey is down then revert -- to last saved version
  else pass undoKey
end undoKey

Use the undoKey Message handler to change the normal Undo process, or prevent use of the Undo keyboard equivalent without changing the menu.

See also: cutKey, copyKey & stack.

Advertisement