You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AutoHotInterception/README.md

40 lines
1.4 KiB
Markdown

6 years ago
# AutoHotInterception
6 years ago
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](http://www.oblita.com/interception)
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
6 years ago
# 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
}
```