Can I ignore a physical key press durring executing?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bertrand
Posts: 11
Joined: 25 Jun 2022, 22:08

Can I ignore a physical key press durring executing?

Post by Bertrand » 07 Oct 2022, 04:54

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

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

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

Post by mikeyww » 07 Oct 2022, 06:04

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

Post Reply

Return to “Ask for Help (v1)”