i've tried the hidmacros, unfortunately when we use the same hotkey for hidmacros and ahk, the ahk hotkey is being prioritized -- which is not good because only hidmacros can detect from which device the keys were coming from.
this script would detect keys that come from the second keyboard by reading an earlier F24 key that sent whenever a key in the second keyboard pressed.
Code:
F24::
secondhid := 1
return
*$q::
*$w::
*$e::
*$r::
*$t::
*$y::
*$u::
*$i::
*$o::
*$p::
*$a::
*$s::
*$d::
*$f::
*$g::
*$h::
*$j::
*$k::
*$l::
*$z::
*$x::
*$c::
*$v::
*$b::
*$n::
*$m::
if (secondhid)
{
; MsgBox kb2
secondhid := 0
hotkey := SubStr(A_ThisHotkey,3)
; pass the keys from kb2 or use call custom function here
send {blind}%hotkey%
} else
{
hotkey := SubStr(A_ThisHotkey,3)
send {blind}%hotkey%
}
return
the only thing it needs is the kbfiltr that would send F24 before every key sent from the second keyboard (which, unfortunately, i have failed to create). hopefully this script will be useful, shall anyone be able to provide the kbfiltr
(maybe would needs some fixes here and there, haven't tested it yet & i'm new in ahk)