Commands & Syntax > Commands > Mouse Commands >

www.perfectkeyboard.com

 

BLOCK - < mouse_block > ... [Pro]

 

Mouse BLOCK
<mouse_block>
Available in: Professional edition

This command blocks mouse events. It can be used when it is necessary to disable mouse events during macro execution, for example, before "wait for mouse" 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 mouse, use "mouse_unblock" command.

 

 

Example (Macro Steps):

 

1

<#> <#> This macro shows how to use 'mouse_block' and 'mouse_unblock' commands

2

Macro execution: ONLY COMMANDS

3

Message SHOW "Information" : "Waiting untill right-click ...." (other parameters: x = 32, y = 32, Window title = Message, Buttons = None, Timeout (seconds) = 0, Always on top = No).

4

Mouse BLOCK

5

WAIT FOR Object = "MOUSE", Event = "PRESS", Parameter = "", Timeout (seconds) = "10", Exact = "0"

6

Mouse UNBLOCK

7

Message CLOSE

Example (Plain Text):

 

<#> This macro shows how to use 'mouse_block' and 'mouse_unblock' commands

<cmds>

<msg>(32,32,"Waiting untill right-click ....","Message",0,0,0,0)

 

<mouse_block>

<waitfor>("MOUSE","PRESS","<mrbd>",10,0)

 

<mouse_unblock>

<msgoff>