# Funktionsreferenz

BlockInput

Disable/enable the mouse and keyboard.

BlockInput ( flag )

Parameter

flag | 1 = Disable user input 0 = Enable user input

Bemerkungen

If BlockInput is enabled, the Alt keypress cannot be sent!
The table below shows how BlockInput behavior depends on 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 95 | No effect.
Windows 98/Me | User input is blocked but AutoIt is also unable to simulate input.
Windows NT 4 (Without ServicePack 6) | No effect.
Windows NT 4 (With ServicePack 6) | User input is blocked and AutoIt can simulate most input.
Windows 2000 | User input is blocked and AutoIt can simulate most input.
Windows XP | User input is blocked and AutoIt can simulate most input. See exceptions below.

If you are using Windows XP then you should be aware that a hotfix released inbetween SP1 and SP2 limited Blockinput so that the ALT key could NOT be sent. This is fixed in XP SP2.
Note that functions such as WinMove() will still work on Windows 98/Me when BlockInput is enabled.

Siehe auch

Send

Beispiel

If @OSVersion &lt;&gt; "WIN_98" And @OSVersion &lt;&gt; "WIN_ME" Then
BlockInput(1)
EndIf
Run("notepad")
WinWaitActive("Untitled - Notepad")
Send("{F5}") ;pastes time and date
BlockInput(0)