Skip to content

Commit 7161740

Browse files
committed
Merge branch 'master' of https://github.com/evilC/TapHoldManager
2 parents d1acc8c + 74a7f73 commit 7161740

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

README.md

+23-16
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,25 @@ If I double-tapped and held on the second tap, then on press the function would
4646

4747
## Syntax
4848
```
49-
thm := new TapHoldManager([ <tapTime = 200>, <prefix = "$"> ])
49+
thm := new TapHoldManager([ <tapTime = 200>, holdTime := -1, <prefix = "$"> ])
5050
thm.Add("<keyname>", <callback (function object)>)
5151
```
5252

5353
The `tapTime` (The amount of time allowed before a tap or hold is called) can be configured and has a default value of 200ms.
54+
The `holdTime` (The amount of time that you need to hold a button for it to be considered a hold) defaults to the same as `tapTime`.
5455
The `prefix` (The prefix used for all hotkeys, default is `$`) can also be configured.
5556

56-
The manager can take these optional parameters.
57-
`thm := new TapHoldManager(100, "$*")`
57+
You can pass as many parameters as you want.
58+
`thm := new TapHoldManager()`
59+
`thm := new TapHoldManager(100, 200, "$*")`
5860

59-
When adding keys, you can also specify parameters to override the manager's default settings
60-
`thm.Add("2", Func("MyFunc2"), 500, "~$")`
61+
When specifying parameters, you can use `-1` to leave that parameter at it's default.
62+
For example, if you only wish to alter the `prefix` (3rd) parameter, you could pass `-1` for the first two parameters.
63+
`thm := new TapHoldManager(-1, -1, "$*")`
64+
65+
When adding keys, you can also add the same parameters to the end to override the manager's default settings
66+
`thm.Add("2", Func("MyFunc2"), 300, 1000, "~$")`
6167

62-
When specifying parameters, you can use `-1` to leave that parameter at it's default.
6368

6469
# Integration with the Interception driver (Multiple Keyboard support)
6570
TapHoldManager can use the [Interception driver](http://www.oblita.com/interception) to add support for per-keyboard hotkeys - you can bind TapHoldManager to keys on a second keyboard, and use them completely independently of your main keyboard.
@@ -94,25 +99,27 @@ thm.Add("1", Func("MyFunc1"))
9499
### AutoHotInterception Subscription Mode
95100
A wrapper is included which extends the TapHoldManager class and replaces the hotkey bind code with Interception bind code.
96101

97-
**Instead of** including the TapHoldManager library, **instead** include the interception version:
102+
**Instead of** including the TapHoldManager library, include the interception version:
98103
```
99104
; #include Lib\TapHoldManager.ahk
100105
#include Lib\InterceptionTapHold.ahk
101106
```
102107

103-
Instantiate `InterceptionTapHold` instead of `TapHoldManager`
104-
`kb1 := new InterceptionTapHold(<VID>, <PID> [, <tapTime>, <block = true>])`
108+
Instantiate `InterceptionTapHold` **instead of** `TapHoldManager`
109+
`kb1 := new InterceptionTapHold(<VID>, <PID> [, <isMouse = 1>, <instance = 1>, <tapTime>, <block>])`
110+
111+
**Required Parameters**
112+
`VID / PID` = The VendorID and ProductID of the device you wish to subscribe to.
113+
To find the VID / PID of your device, you can use the Monitor demo app from the AHI project.
105114

106-
In this version, the VID and PID of the device need to be passed as the first two parameters.
107-
To get VIDs / PIDs, you can call `devices := kb1.GetKeyboardList()`
108-
Also, the `prefix` parameter is now the `block` parameter
115+
**Optional Parameters**
116+
`isMouse` = Set to true if the device is a Mouse, else leave on false.
117+
`instance` = When using multiple identical devices, this identifies which instance to use.
118+
If you only have one device, leave this at 1
119+
`block` = whether or not to block the input. Defaults to true.
109120

110121
Note: Use one manager per keyboard.
111122
```
112123
kb1 := new InterceptionTapHold(0x413C, 0x2107)
113124
kb2 := new InterceptionTapHold(0x1234, 0x2107)
114125
```
115-
116-
## Optional Parameters
117-
`tapTime` remains the same
118-
`prefix` is replaced by `block` - `true` to block, `false` to not block

0 commit comments

Comments
 (0)