Page 1 of 1

Can I ignore a physical key press durring executing?

Posted: 07 Oct 2022, 04:54
by Bertrand
Hi,
Here is my code.

Code: Select all

^NumpadLeft::
Send {Ctrl up}
BlockInput, MouseMove
Mouseclick, , , , 1, , D
Sleep, 100
MouseMove, -1, 0, , R
Sleep, 100
Mouseclick, , , , 1, , U
BlockInput, MouseMoveOff
return
This code includes Ctrl as a hotkey, and a program has its own behavior with Ctrl+click. So this code does something unexpected. Because Ctrl key is pressing during executing.
However I really want to use Ctrl... Is it possible blocking a physical key press during executing?
Thanks in advance

Re: Can I ignore a physical key press durring executing?

Posted: 07 Oct 2022, 06:04
by mikeyww
Hi,

See OnOff parameter for :arrow: BlockInput. It may require admin privileges.

Or:

Code: Select all

F3::
on := True
Send m
KeyWait, F3
Send x
on := False
#If on
a::Return
#If
This just demonstrates how #If can be used to set a context or condition for a hotkey. Setting the hotkey to Return means that nothing will happen when the hotkey is triggered.

Another:

Code: Select all

F3::
Send m
KeyWait, F3
Send x
#If GetKeyState("F3", "P")
a::Return
#If