Commands & Syntax > Commands > Keyboard >

www.perfectkeyboard.com

 

BLOCK - < keys_block > ... [Pro]

 

Keyboard BLOCK
<keys_block>
Available in: Professional edition

This command blocks keyboard keys. It can be used when it is necessary to disable keyboard input during macro execution, for example, before "wait for key" command ("waitfor"). If it is required to disable keyboard and mouse input during whole macro execution then it is also possible to use "Lock keyboard and mouse while macro is running" option in the macro settings tab. To unblock keyboard, use "keys_unblock" command.

 

 

Example (Macro Steps):

 

1

<#> <#> This macro shows how to use 'keys_block' and 'keys_unblock' commands

2

Macro execution: ONLY COMMANDS

3

Message SHOW "Information" : "Waiting untill 'a' key is pressed...." (other parameters: x = 32, y = 32, Window title = Message, Buttons = None, Timeout (seconds) = 0, Always on top = No).

4

Keyboard BLOCK

5

WAIT FOR Object = "KEY", Event = "PRESS", Parameter = "a", Timeout (seconds) = "50", Exact = "0"

6

WAIT FOR Object = "KEY", Event = "RELEASE", Parameter = "a", Timeout (seconds) = "50", Exact = "0"

7

Keyboard UNBLOCK

8

Message CLOSE

Example (Plain Text):

 

<#> This macro shows how to use 'keys_block' and 'keys_unblock' commands

<cmds>

<msg>(32,32,"Waiting untill 'a' key is pressed....","Message",0,0,0,0)

<keys_block>

<waitfor>("KEY","PRESS","a",50,0)

<waitfor>("KEY","RELEASE","a",50,0)

<keys_unblock>

<msgoff>