mirror of
https://github.com/evilC/AutoHotInterception.git
synced 2024-11-16 21:25:46 +00:00
An AutoHotkey wrapper for the Interception driver
C# | ||
Lib | ||
.gitattributes | ||
.gitignore | ||
ContextCallback.ahk | ||
Example.ahk | ||
LICENSE | ||
README.md |
AutoHotInterception
AutoHotInterception(AHI) allows you to execute AutoHotkey code in response to keys on a specific keyboard, whilst (optionally) blocking the native functionality of that key.
In other words, you can use a key on a second (or third, or fourth..) keyboard to trigger AHK code, and that key will not be seen by applications. You can use the same key on multiple keyboards for individual actions.
AHI uses the Interception driver by Francisco Lopez
Setup
- Download and install the Interception Driver
- Download a zip from the releases page and extract it to a folder
- Copy the
interception.dll
from the folder where you ran the interecption install into thelib
folder
(You can optionally place the contents of thelib
folder inMy Documents\AutoHotkey\lib
- Edit the example script, enter the VID and PID of your keyboard
- Run the example script
Usage
Include the library
#Persistent ; (Interception hotkeys do not stop AHK from exiting, so use this)
#include Lib\AutoHotInterception.ahk
Initialize the library
Interception := AutoHotInterception_Init()
Subscribe to a key on a specific keyboard
Interception.SubscribeKey(GetKeySC("1"), true, Func("KeyEvent"), VID, PID)
return
Callback function is passed state 0 (released)
or 1
(pressed)
KeyEvent(state){
ToolTip % "State: " state
}