feat(behaviors): &key_repeat behavior + tests.

* Add new `&key_repeat` behavior that captures and re-sends
  the most recently triggered keycode.

Closes: #853
This commit is contained in:
Peter Johanson
2021-11-29 04:26:22 +00:00
committed by Pete Johanson
parent ac3c3170bd
commit 70bb7c9334
16 changed files with 278 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
---
title: Key Repeat Behavior
sidebar_label: Key Repeat
---
## Summary
The key repeat behavior when triggered will send whatever keycode was last sent/triggered.
### Behavior Binding
- Reference: `&key_repeat`
Example:
```
&key_repeat
```
### Configuration
#### Usage Pages
By default, the key repeat will only track the last pressed key from the HID "Key" usage page, and ignore events from other usages, e.g. Consumer page.
If you'd rather have the repeat also capture and send Consumer page usages, you can update the existing behavior:
```
&key_repeat {
usage-pages = <HID_USAGE_KEY HID_USAGE_CONSUMER>;
};
/ {
keymap {
...
};
};
```