Thanks for your response -- I think you're right.
I've now studied the AHK documentation in more detail and used a
script called KeyStateMonitor which I found in the AHK forums to run
several experiments. KeyStateMonitor reports back in real-time the
"logical" and the "physical" states of the key(s) one is monitoring,
which are usually the same unless AHK's low-level keyboard hook is
installed.
Certain functionality in AHK requires that its low-level keyboard hook
be installed. When the keyboard hook is installed, the logical state
of a key is whatever the object (window, ...) receiving the event
thinks it is, which is not necessarily the same as the physical state
of the key (i.e. whether the user is physically pressing down the key
or not). Since Input Director sends "simulated" keystrokes, the
keyboard hook distinguishes them from physical keystrokes, creating a
problem for using the KeyWait command in hotkeys to detect physical up/
down keyevents.
In short, is there a way to include an option in Input Director to
send physical key events instead of simulated ones to the slave, if
this is even possible? If so, that would allow more AHK scripts
running on the slave to be controlled by the master without
modification.
If not, I'll continue digging on the AHK side of this issue to see if
there is a workaround -- although the output from the following simple
example is a little discouraging:
Z::
keystate:=GetKeyState("Z")
MsgBox, %keystate%
return
This returns a 0 after pressing the Z key not only when connecting to
the slave from the master but also when typing on the keyboard
connected directly to the slave. This invocation of the GetKeyState
returns the logical state of Z, not the physical. It appears that the
hotkey trigger (Z::) discards the simulated keydown event before the
GetKeyState("Z") inside the hotkey definition can see it. On the
other hand, if instead one calls GetKeyState("Z","P") when typing Z on
the keyboard attached directly to slave, the script returns 1.
I hope the above discussion does not contain more detail than you want
to digest regarding Input Director's interaction with AHK. Again,
thanks for your response and for sharing with everyone such a great
piece of software.