Re: TapHoldManager - Long Press / Multi Tap / Multi Tap and Hold / Any number of Taps / Multi-Keyboard / Joystick button
Posted: 23 Feb 2022, 09:31
I have this keypad mapped and working perfectly with AHI, but cannot for the life of me get InterceptionTapHold work in any way.
Has anyone got the example scripts for InterceptionTapHold to work?
Just to clarify, I'm focussing on InterceptionTapHoldDemo.ahk which should show ToolTips when "1" or "2" key is pressed and should also block the keyboard1Id specified keypad like AHI does.
InterceptionTapHoldDemo.ahk doesn't throw any errors when I run it, so it's definitely okaying the PID and VID but not doing anything after that.
Why is it seeing the keypad USB ID but not blocking it nor assigning keys to it?
On the other hand the InterceptionSubscriptionModeExample.ahk continues to throw "Unknown mouse button name 1" and immediately closes.
Why does it only look for a mouse key and not a keyboard?
Any help or ideas on where it might be getting stuck would be greatly appreciated. Thanks.
Has anyone got the example scripts for InterceptionTapHold to work?
Just to clarify, I'm focussing on InterceptionTapHoldDemo.ahk which should show ToolTips when "1" or "2" key is pressed and should also block the keyboard1Id specified keypad like AHI does.
InterceptionTapHoldDemo.ahk doesn't throw any errors when I run it, so it's definitely okaying the PID and VID but not doing anything after that.
Why is it seeing the keypad USB ID but not blocking it nor assigning keys to it?
On the other hand the InterceptionSubscriptionModeExample.ahk continues to throw "Unknown mouse button name 1" and immediately closes.
Why does it only look for a mouse key and not a keyboard?
Any help or ideas on where it might be getting stuck would be greatly appreciated. Thanks.
jkwaza wrote: ↑19 Feb 2022, 11:02Weeks of trying to solve this. Please help!
This is the Interception Mode Subscription Example.
Whenever I run it says: "Unknown mouse button name 1", the "1" is whatever key I add to kb1.
Also when I un-comment to get a list of devices, it shows a blank box, which is puzzling as I can get AutoHotInterception working very well.
Code: Select all
#include Lib\AutoHotInterception.ahk #include Lib\TapHoldManager.ahk #include Lib\InterceptionTapHold.ahk #Persistent ; Interception scripts may not declare hotkeys, so you may need this to stop it exiting #SingleInstance force ; Add the VID / PID of the keyboard you wish to filter here VID1 := 0x04D9, PID1 := 0xA0F8 kb1 := new InterceptionTapHold(VID1, PID1) ; TapTime / Prefix can now be set here kb1.Add("1", Func("Kb1Func")) ; TapFunc / HoldFunc now always one function ; Un-Comment this to get a list of devices ;devices := kb1.GetKeyboardList() ;Clipboard := devices ;msgbox % devices Kb1Func(isHold, taps, state){ ToolTip % "KB 1 Key 1`n" (isHold ? "HOLD" : "TAP") "`nTaps: " taps "`nState: " state } Kb2Func(isHold, taps, state){ ToolTip % "KB 2 Key 1`n" (isHold ? "HOLD" : "TAP") "`nTaps: " taps "`nState: " state }
I have also tried this too in Interception Tap Hold Demo, which doesn't subscribe/block keyboard nor assign a key.
I've come back to this so many times to give my external numpad TapHold functionality, but just having no luck. It looks like the clues are in TapHoldManager.ahk and InterceptionTapHold.ahk, but I cannot fully wrap my head around those.
Has anyone else experienced this?
What am I doing wrong?
Code: Select all
#SingleInstance force #include <AutoHotInterception> #include <InterceptionTapHold> #include <TapHoldManager> AHI := new AutoHotInterception() keyboard1Id := AHI.GetKeyboardId(0x04D9, 0xA0F8) ;keypad ITH1 := new InterceptionTapHold(AHI, keyboard1Id) ;ITH1 := new TapHoldManager() ITH1.Add("1", Func("Func1")) ITH1.Add("2", Func("Func2")) return Func1(isHold, taps, state){ ToolTip % "KB 1 Key 1`n" (isHold ? "HOLD" : "TAP") "`nTaps: " taps "`nState: " state } Func2(isHold, taps, state){ ToolTip % "KB 1 Key 2`n" (isHold ? "HOLD" : "TAP") "`nTaps: " taps "`nState: " state }