An AutoHotkey wrapper for the Interception driver
Go to file
Clive Galway ad05139754 Comment
2018-03-07 21:06:24 +00:00
C# Add Context mode 2018-03-07 20:46:37 +00:00
Lib Add AHK wrapper, sample 2018-03-06 19:53:04 +00:00
.gitattributes Initial commit 2018-03-06 18:03:45 +00:00
.gitignore ignore zips 2018-03-06 20:13:40 +00:00
ContextCallback.ahk Comment 2018-03-07 21:06:24 +00:00
Example.ahk put devicelist on clipboard 2018-03-06 20:27:16 +00:00
LICENSE Initial commit 2018-03-06 18:03:45 +00:00
README.md Update README.md 2018-03-07 01:58:23 +00:00

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

  1. Download and install the Interception Driver
  2. Download a zip from the releases page and extract it to a folder
  3. Copy the interception.dll from the folder where you ran the interecption install into the lib folder
    (You can optionally place the contents of the lib folder in My Documents\AutoHotkey\lib
  4. Edit the example script, enter the VID and PID of your keyboard
  5. 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
}