Implement suggested documentation changes
* Clarify how `wait` and `toggle` work * Add additional example code
This commit is contained in:
parent
c6bbd49d05
commit
c5c927acf2
@ -13,8 +13,8 @@ Some instances where this may be useful are:
|
|||||||
## Keycodes
|
## Keycodes
|
||||||
|
|
||||||
| Key | Description |
|
| Key | Description |
|
||||||
| :------ | :--------------------------------------------------- |
|
| :---------- | :--------------------------------------------------- |
|
||||||
| `KC.RF` | Repeatedly sends the specified keycode while pressed |
|
| `KC.RF(kc)` | Repeatedly sends the specified keycode while pressed |
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -23,12 +23,12 @@ Each repeat counts as one full cycle of pressing and releasing. RapidFire works
|
|||||||
The RapidFire keycode has a few different options:
|
The RapidFire keycode has a few different options:
|
||||||
|
|
||||||
| Option | Default Value | Description |
|
| Option | Default Value | Description |
|
||||||
| :-------------------: | :-----------: | :------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| :-------------------: | :-----------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `repeat` | `100` | The delay between repeats. Note: `2` appears to be the minimum effective value. If you run into issues, try increasing this value. |
|
| `repeat` | `100` | The delay between repeats in milliseconds. Note: `10` appears to be the minimum effective value. If you run into issues, try increasing this value. |
|
||||||
| `wait` | `200` | The delay before starting to repeat. Useful if you want to be able to type with keys that have a low `repeat` value. |
|
| `wait` | `200` | The delay before starting to repeat in milliseconds. Useful if you want to be able to type with keys that have a low `repeat` value. A value of `0` will result in no waiting period. |
|
||||||
| `randomize_repeat` | `False` | Randomize the value of `repeat`. Useful for making the repetitive input look human in instances where you may be flagged as a bot otherwise. |
|
| `randomize_repeat` | `False` | Randomize the value of `repeat`. Useful for making the repetitive input look human in instances where you may be flagged as a bot otherwise. |
|
||||||
| `randomize_magnitude` | `15` | The magnitude of the randomization. If randomization is enabled, the repeat delay will be `repeat` plus or minus a random value up to this amount. |
|
| `randomize_magnitude` | `15` | The magnitude of the randomization. If randomization is enabled, the repeat delay will be `repeat` plus or minus a random value up to this amount. |
|
||||||
| `toggle` | `False` | Toggle RapidFire state on keypress rather than needing to be held. Toggle functionality starts after the `wait` period. |
|
| `toggle` | `False` | If set to `True`, activating RapidFire will toggle it on or off. Useful if you don't want to have to keep the button held. Set `wait` to `0` if you would like to toggle on tap. |
|
||||||
|
|
||||||
### Example Code
|
### Example Code
|
||||||
|
|
||||||
@ -37,9 +37,14 @@ from kmk.modules.rapidfire import RapidFire
|
|||||||
|
|
||||||
keyboard.modules.append(RapidFire())
|
keyboard.modules.append(RapidFire())
|
||||||
|
|
||||||
# After 200 milliseconds, repeatedly send Shift+A every 75-125 milliseconds until the button is pressed again
|
# After 200 milliseconds, repeatedly send Shift+A every 75-125 milliseconds while the button is held
|
||||||
|
SPAM_A = KC.RF(KC.LSFT(KC.A), wait=200, repeat=100, randomize_repeat=True, randomize_magnitude=25)
|
||||||
|
# Immediately toggle repeatedly sending Enter every 50 milliseconds on tap
|
||||||
|
SPAM_ENTER = KC.RF(KC.ENT, toggle=True, wait=0, repeat=50)
|
||||||
|
|
||||||
|
|
||||||
keyboard.keymap = [[
|
keyboard.keymap = [[
|
||||||
KC.RF(KC.LSFT(KC.A), wait=200, repeat=100, randomize_repeat=True, randomize_magnitude=25, toggle=True)
|
SPAM_A, SPAM_ENTER
|
||||||
]]
|
]]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user