From 59856aa0cff104459e82eea3fe832f5fe02ce412 Mon Sep 17 00:00:00 2001 From: Clive Galway Date: Thu, 8 Mar 2018 00:09:00 +0000 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d15a37b..b7d041d 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Create your hotkeys, wrapped in an `#if` block for that context variable ``` ## Subscription mode -In Subscription mode, you bypass AHK's hotkey system completely, and Interception notifies you og key events via callbacks. +In Subscription mode, you bypass AHK's hotkey system completely, and Interception notifies you of key events via callbacks. Subscribe to a key on a specific keyboard `SubscribeKey(, , , , ` From ecc52e06e677df68a8a17cd62c9517d372c95705 Mon Sep 17 00:00:00 2001 From: Clive Galway Date: Thu, 8 Mar 2018 00:11:38 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b7d041d..2fe79c4 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,12 @@ Include the library Initialize the library ``` Interception := AutoHotInterception_Init() -``` +``` + +## Modes +There are two modes of operation for AHI, currently each script can only use one of them. -## Context mode +### Context mode Context mode is so named as it takes advantage of AutoHotkey's [Context Sensitive Hotkeys](https://autohotkey.com/docs/Hotkeys.htm#Context). In AHK, you can wrap your hotkeys in a block like so: ``` @@ -37,14 +40,14 @@ F1::Msgbox You Pressed F1 This hotkey would only fire if the `myVariable` was 1. In context mode, you subscribe to a keyboard, and any time events for that keyboard are just about to happen, then AHI fires your callback, and you set this variable to `1` the hotkey is enabled. After your hotkey fires, AHI fires the callback again and the variable gets set back to `0`. -### Step 1 +#### Step 1 Register your callback with AHI ``` VID := 0x04F2, PID := 0x0112 Interception.SetContextCallback(VID, PID, Func("SetKb1Context")) ``` -### Step 2 +#### Step 2 Create your callback function, and set the context variable to the value of `state` ``` SetKb1Context(state){ @@ -54,7 +57,7 @@ SetKb1Context(state){ } ``` -### Step 3 +#### Step 3 Create your hotkeys, wrapped in an `#if` block for that context variable ``` #if isKeyboard1Active @@ -69,7 +72,7 @@ Create your hotkeys, wrapped in an `#if` block for that context variable #if ``` -## Subscription mode +### Subscription mode In Subscription mode, you bypass AHK's hotkey system completely, and Interception notifies you of key events via callbacks. Subscribe to a key on a specific keyboard