Update README.md

pull/32/head v0.3.7
Clive Galway 5 years ago committed by GitHub
parent fb192d1df6
commit c910949bb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
@ -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
@ -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"))
@ -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"))

Loading…
Cancel
Save