Disable/enable the mouse and keyboard.
BlockInput ( flag )
Parameters
| flag | 1 = Disable user input 0 = Enable user input |
Return Value
| Success: | Returns 1. |
| Failure: | Returns 0. Already Enable or #requireAdmin not used. |
Remarks
The table below shows how BlockInput behavior depends on the Windows version; however, pressing Ctrl+Alt+Del on any platform will re-enable input due to a Windows API feature.| Operating System | "BlockInput" Results |
| Windows 2000 | User input is blocked and AutoIt can simulate mouse and keyboard input. |
| Windows XP | User input is blocked and AutoIt can simulate mouse and keyboard input. See remarks below for an issue with Windows XP SP1. |
| Windows Vista | User input is blocked and AutoIt can simulate mouse and keyboard if #RequireAdmin is used. |
Related
Send
Example
BlockInput(1)
Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}") ;pastes time and date
BlockInput(0)