evilC / AutoHotInterception

An AutoHotkey wrapper for the Interception driver
MIT License
707 stars 64 forks source link

AHI.SendKeyEvent doesn't seem to set the .isActive context for that device #77

Closed mmelon closed 3 years ago

mmelon commented 3 years ago

If I send a key as id1, shouldn't it trigger this hotkey 2:: AHI.SendKeyEvent(id1, GetKeySC("1"), 1) return

if cm1.isActive

1:: tooltip,it worked return

if

or it might be a problem with sendkeyevent not respecting send level?

Basically I can't get my context hotkeys to trigger from sendkeyevent

mmelon commented 3 years ago

actually i apologise it does work. I just can't get it to work across two different scripts. So script A is sendkeyevent ing and script B is #if cm1.isActive

I can't get script A to trigger script B

evilC commented 3 years ago

Only one script at a time can be interacting with each keyboard, so this would never work I am surprised even that it does work when does as part of one script - I certainly did not design it to support that use-case If you want one script to trigger actions in another script, sending keys from one script to be read from another is a poor way to do it anyway - use something like talk() https://www.autohotkey.com/boards/viewtopic.php?t=67939

mmelon commented 3 years ago

thanks for that. Talk looks very useful.