Skip to content

Commit 3c6ba33

Browse files
authored
Update README.md
1 parent 5cbcc55 commit 3c6ba33

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

+11-6
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.

0 commit comments

Comments
 (0)