Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
evilC authored Feb 10, 2019
1 parent fb192d1 commit c910949
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ cm1 := AHI.CreateContextManager(keyboard1Id)
In Subscription mode, you bypass AHK's hotkey system completely, and Interception notifies you of key events via callbacks.
All forms of input are supported in Subscription Mode.
Subscription Mode overrides Context Mode - that is, if a key on a keyboard has been subscribed to with Subscription Mode, then Context Mode will not fire for that key on that keyboard.
Each Subscribe endpont also has a corresponding Unsubscribe endpoint, which removes the subscription and any block associated with it.

#### Subscribing to Keyboard keys
Subscribe to a key on a specific keyboard
`SubscribeKey(<deviceId>, <scanCode>, <block>, <callback>)`
Subscribe to a key on a specific keyboard
`SubscribeKey(<deviceId>, <scanCode>, <block>, <callback>)`
`UnsubscribeKey(<deviceId>, <scanCode>)`
```
Interception.SubscribeKey(keyboardId, GetKeySC("1"), true, Func("KeyEvent"))
return
Expand All @@ -179,6 +181,7 @@ KeyEvent(state){

#### Subscribing to Mouse Buttons
`SubscribeMouseButton(<deviceId>, <button>, <block>, <callback>)`
`UnsubscribeMouseButton(<deviceId>, <button>)`
Where `button` is one of:
```
0: Left Mouse
Expand All @@ -201,8 +204,13 @@ Keep your callbacks **short and efficient** in this mode if you wish to avoid hi

##### Relative Mode
Relative mode is for normal mice and most trackpads.
Coordinates will be delta (change)
Coordinates will be delta (change)
Each endpoint has two naming variants for convenience, they both do the same.

`SubscribeMouseMove(<deviceId>, <block>, <callback>)`
`SubscribeMouseMoveRelative(<deviceId>, <block>, <callback>)`
`UnsubscribeMouseMove(<deviceId>)`
`UnsubscribeMouseMoveRelative(<deviceId>)`
For Mouse Movement, the callback is passed two ints - x and y.
```
Interception.SubscribeMouseMove(mouseId, false, Func("MouseEvent"))
Expand All @@ -215,6 +223,8 @@ MouseEvent(x, y){
##### Absolute Mode
Absolute mode is used for Graphics Tablets, Light Guns etc.
Coordinates will be in the range 0..65535
`SubscribeMouseMoveAbsolute(<deviceId>, <block>, <callback>)`
`UnsubscribeMouseMoveAbsolute(<deviceId>)`
```
Interception.SubscribeMouseMoveAbsolute(mouseId, false, Func("MouseEvent"))
Expand Down

0 comments on commit c910949

Please sign in to comment.