Block Input

Verb: blockInput

Available from: <Standard>

Blocks keyboard and mouse inputs on the machine where the command is executed.

Syntax

blockInput (Boolean)=value

Outputs

Script Designer AcceptedTypes Description
value Success Boolean Returns "True", if the keyboard and mouse inputs were blocked successfully, or "False", if an error has prevented the blocking.

Example

The Block Input command is used to block the keyboard and mouse, so that the user cannot type until Notepad++ is open. After being opened, the Unblock Entry command unblocks the inputs.

defVar --name notepadWindow --type Window
defVar --name success --type Boolean
// Open Notepad++ through the directory path.
launchWindow --executablepath "C:\\Program Files\\Notepad++\\notepad++.exe" notepadWindow=value
// Blocks keyboard and mouse.
blockInput success=value
// Put Notepad ++ in the foreground.
focusWindow --window ${notepadWindow}
delay --timeout 00:00:01
logMessage --message "${success}" --type "Info"
// Unlocks keyboard and mouse.
unBlockInput success=value
logMessage --message "${success}" --type "Info"

See Also

  • Mouse Click
  • Mouse Command
  • Press or Release Key
  • Send Key
  • Type Text
  • Unblock Entry