TapHoldManager icon indicating copy to clipboard operation
TapHoldManager copied to clipboard

Multi tap + Hold sending another key

Open axsddlr opened this issue 5 years ago • 2 comments

trying to set a hold to a keybind to send F24 from F15 (using macropad) it send the macro combo but then sends "Alt + Shift" right after in AHK not sure why, code below:

#include D:\Docs\AutoHotKey\Libs\TapHoldManager.ahk

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

DetectHiddenWindows, On

#SingleInstance force

thm := new TapHoldManager()	; TapTime / Prefix can now be set here
thm.Add("F15", Func("OBScenes"), -1, 300, -1, "$*")


OBScenes(isHold, taps, state){
WinActivate, OBS ahk_exe obs64.exe
	if (isHold){
		; Holds
		if (state){
            Send  {LShift down}{F24 down}
		} else {
            Send  {LShift up}{F24 up}
		}
	} else {
		; Taps
		if (taps == 1){
			 Send  {LCtrl down}{LShift down}{F24 down}
		      Sleep, 10
			 Send  {LCtrl up}{LShift up}{F24 up} ;Intro Scene
		} else if (taps == 2){
		      Sleep, 10
			 Send !+{F24}  ;AFK Scene
		}
	}
}

axsddlr avatar Jul 26 '19 01:07 axsddlr

I don't see any obvious reason why. Does the same issue repro if you use a normal key as the trigger key? (eg F12) Suspect issue could be to do with using F keys above F12

evilC avatar Jul 26 '19 09:07 evilC

confirmed f1-f12 seems to act the same way, only taps seems to work

axsddlr avatar Jul 27 '19 02:07 axsddlr