Lock/Unlock Keyboard and Mouse
These commands are inserted directly into the script as there is not an edit window associated with them. From the Script Editor click on the Keyboard category of commands to expand the category. Then select either the Lock Keyboard and Mouse or the Unlock Keyboard and Mouse command to insert into the script.
Lock Keyboard and Mouse
The lock Keyboard and Mouse command is used to prevent the user from typing or moving the mouse during playback of a macro, so that the macro is not disrupted. Once the macro has completed, keyboard and mouse control are returned to the user.
Unlock Keyboard and Mouse
It is not necessary to insert this command at the end of a macro to unlock the keyboard and mouse. This occurs automatically when the macro has finished playback.
Use this option when the Lock Keyboard and Mouse command is active and the macro contains a prompt for the user to input information, navigate to a file, etc. Insert the Unlock Keyboard and Mouse command into the script before the prompt to allow the user to take appropriate action. Lock the keyboard and mouse again or leave them unlocked for the remainder of the macro playback.
üNote: This command will not work in Windows Vista or later unless running Macro Express in Administrator mode.
Caution: This is a Windows function that completely locks the keyboard and mouse. Use with caution. The keyboard and mouse remain locked if the macro gets stuck or an unexpected dialog appears during playback.
In these situations, the key to regaining control of the mouse and keyboard is pressing the Ctrl + Alt + Delete keys. The lock keyboard command does not prevent this key combination from working. Depending on the version of Windows being used, one or two additional steps may be required.
Press (Ctrl + Alt + Delete) to display the screen to lock the computer, open the task manager, etc. Press the Cancel button or Cancel arrow and control of the mouse and keyboard is returned.