Closed PotatoJet closed 4 years ago
That script only has one keyboard in it, so is no different to the example?
That script only has one keyboard in it, so is no different to the example?
I'm sorry that I didn't get the full screenshot,here it is.My 3rd keyboard just can't work with function. How to edit 3rd_keyboard script?I really appreciate.
That has unreachable code
cm1 := AHI.CreateContextManager(id1)
return ; EXECUTION STOPS HERE
; ...
id2 := AHI.GetKeyboardId(0x25A, 0x001F, 1) ; THIS LINE NEVER EXECUTES
cm2 := AHI.CreateContextManager(id2)
Instead you want like
#SingleInstance force
#Persistent
#include Lib\AutoHotInterception.ahk
AHI := new AutoHotInterception()
id1 := AHI.GetKeyboardId(0x04F2, 0x0112, 1)
cm1 := AHI.CreateContextManager(id1)
id2 := AHI.GetKeyboardId(0x25A, 0x001F, 1)
cm2 := AHI.CreateContextManager(id2)
return
#if cm1.IsActive
; ...
#if
#if cm2.IsActive
; ...
#if
That has unreachable code
cm1 := AHI.CreateContextManager(id1) return ; EXECUTION STOPS HERE ; ... id2 := AHI.GetKeyboardId(0x25A, 0x001F, 1) ; THIS LINE NEVER EXECUTES cm2 := AHI.CreateContextManager(id2)
Instead you want like
#SingleInstance force #Persistent #include Lib\AutoHotInterception.ahk AHI := new AutoHotInterception() id1 := AHI.GetKeyboardId(0x04F2, 0x0112, 1) cm1 := AHI.CreateContextManager(id1) id2 := AHI.GetKeyboardId(0x25A, 0x001F, 1) cm2 := AHI.CreateContextManager(id2) return #if cm1.IsActive ; ... #if #if cm2.IsActive ; ... #if
It works!Thank you very very much,you just save my life! I will make a tutorial on Youtube to show that AHI is awesome. evilC,You are genius!Thanks.
I have finished 2nd keyboard assignment. Then I try to change id1 to id2,and cm1 to cm2,and VID \ PID is also changed,but my 3rd keyboard still can't work with function. Please help me out here,thank you so much.