Disable a key while another is hield.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest

Disable a key while another is hield.

14 Oct 2018, 21:07

Shouldn't be too hard basically looking for this:

While Space is hield/press -> Temporarily disable mouse right click + spam "N" every 100ms -> once space is realeased; right click work normally again.

(I have a macro spamming right click while hield no delay)

Without the need to repress right click would be perfect.


Thank if anyone can help with this :thumbup:
eqv
Posts: 72
Joined: 18 Sep 2018, 22:17

Re: Disable a key while another is hield.

15 Oct 2018, 11:41

Guest wrote:
14 Oct 2018, 21:07
Shouldn't be too hard basically looking for this:

While Space is hield/press -> Temporarily disable mouse right click + spam "N" every 100ms -> once space is realeased; right click work normally again.

(I have a macro spamming right click while hield no delay)

Without the need to repress right click would be perfect.


Thank if anyone can help with this :thumbup:
I'm not sure I get it; but try this:

Code: Select all

$Space::
	KeyWait, Space, T0.2	;; wait 200ms for held
	If (ErrorLevel) {
		While (getKeyState("Space","P")) {
		Send, N		;; Spam "N"
		Sleep, 100	;; wait 100ms
	}} else
		SendInput, {space}		
	Return

#If (getKeyState("Space","P"))	;; << Blocks "RButton" (right click) while pressing
RButton::Return
RButton & Space::Return
#If
If "Space" press fast, then send normal "Space"; if held down, send "N" and blocks right click.
• IMPORTANT: For Autohotkey, "RButton & Space" is different than "Space & RButton"; that gave me a hard time :( .

Hope it helps,

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], jeves, Thorlian and 157 guests