Commit Graph

104 Commits

Author SHA1 Message Date
Horu
7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -04:00
Theo Lemay
ce743f2b35 chore: fix whitespace 2024-03-18 10:30:14 -07:00
Theo Lemay
af7e4198ae chore: remove label in test 2024-03-18 10:30:14 -07:00
Theo Lemay
341534aa15 feat(behaviors): lazy sticky keys 2024-03-18 10:30:14 -07:00
honorless
6f2e19ff88 refactor: replace quick_tap_ms with quick-tap-ms
* The underscore form of this property is deprecated.
2024-03-18 10:15:50 -07:00
honorless
3a38979684 refactor: replace tapping_term_ms with tapping-term-ms
* The underscore form of this property is deprecated.
2024-03-18 10:15:50 -07:00
Theo Lemay
8b20874c99 chore: remove label in test 2024-02-20 00:25:53 -08:00
Theo Lemay
c007d60357 feat(behaviors): hold while undecided 2024-02-20 00:25:53 -08:00
Peter Johanson
cd6f8a680c fix(ble): Update security test for changes in 3.5. 2024-02-09 14:32:46 -08:00
Peter Johanson
b3f1d769f0 fix(bt): Fixes for BLE test BSIM bits. 2024-02-09 14:32:46 -08:00
Peter Johanson
4fcbe3268a fix(bt): Updated snapshots for BLE tests.
* Core Zephyr changes tweaked the output from the
  BT stack for our unit tests.
2024-02-09 14:32:46 -08:00
Pete Johanson
69f962fab2 feat(ble): Add security related tests.
* Add security related tests to verify behavior when trying to read
  a GATT characteristic from our peripheral with and without client
  auto security request/retry.
2024-01-05 12:17:59 -08:00
Peter Johanson
a593c7260a feat(bt): Add test for unauth overwrite.
* Add a test to ensure unauth overwrite does the right thing when
  hosts try to pair again without the profile cleared on the ZMK side.
2023-12-18 13:18:09 -08:00
Joel Spadin
17a6f0b128 refactor: Remove new uses of label property
Removed new uses of the "label" property which were introduced after
the previous commits on this branch were written.
2023-12-04 20:06:54 -06:00
Joel Spadin
23ecf08119 refactor(behaviors)!: Remove labels from behaviors
Removed the label property from built-in behaviors, custom behaviors
defined in a few keymaps, and macros generated with ZMK_MACRO().

Now that node names are used to identify behaviors, and names only need
to be unique within the set of behaviors, the names of all behaviors
have been shortened to be similar to their original labels.

This means that any keymaps which reference behavior nodes by name
instead of by label will need to be updated. Keymaps typically use the
labels though, so most keymaps should be unaffected by this change.
2023-12-04 20:06:54 -06:00
Joel Spadin
ba5637fdef refactor: Remove unimportant labels
Removed "label" properties which no longer have any function.

Labels are still used as layer names and as identifiers for sending
behaviors between sides of a split keyboard, so those have been left
alone for now.
2023-12-04 20:06:54 -06:00
Peter Johanson
693530c2f1 feat(bluetooth): Initial nRF52 BSIM based test support.
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-12-02 17:11:45 -08:00
Alexander Krikun
d7d9eed317 feat(mouse): Initial mouse keys support.
* Add HID report/descriptor for a new report with mouse buttons,
  and x/y/wheel deltas.
* New mouse key press behavior for press/release of mouse keys.
* Add constants for HID main item values (e.g. data/array/absolute)
* Define and use constants for our HID report IDs.
2023-11-15 11:16:59 -08:00
Andrew Rae
11996ff7f0 refactor(behaviors): Final global-quick-tap deprecation. 2023-10-03 01:12:47 -07:00
Andrew Rae
f0f6d61e79 fix(tests): Updating old tests includes 2023-10-03 01:12:47 -07:00
Andrew Rae
b85ffa4b6c refactor(behaviors): global-quick-tap -> require-prior-idle
Renaming global-quick-tap-ms to require-prior-idle.
2023-10-03 01:12:47 -07:00
Andrew Rae
77eb44ba9b feat(behaviors): Adding global-quick-tap-ms for combos
This brings the 'global-quick-tap' functionality to combos by filtering
out candidate combos that fell within their own quick tap term.

I also replaced `return 0` with `return ZMK_EV_EVENT_BUBBLE` where appropriate.
(I assume this was done in past as it is similar to errno returning, but
being that this is to signify an event type I find this more clear)
2023-10-03 01:12:47 -07:00
Andrew Rae
2f6abff3bc refactor(behaviors): Giving global-quick-tap its own term
Detaching the global-quick-tap functionality from the quick-tap term.
This makes way for two improvements:

1. This functionality can be added to combos under a unified name
   'global-quick-tap-ms'.

2. This allows users to set a lower term for the 'global-quick-tap'
   (typically ~100ms), and a higher term for the regular
   quick-tap (typically ~200ms)

This deprecates the global-quick-tap option, however if it is set, the
quick-tap-ms value will be copied to global-quick-tap-ms.
2023-10-03 01:12:47 -07:00
Flo Kempenich
aa4cb143bf
fix(combos)Fix bug with overlapping combos timeouts (#1945)
* Fix bug with overlapping combos timeouts

* Fix trailing whitespace

* Fix log format
2023-10-03 04:03:59 -04:00
Andrew Rae
dffdb2365e test(core): Adding coverage for key pre-releasing.
Added cases for the two use cases I know of:
    1. Rolling with key-repeat behavior
    2. Rolling symbols that have the same base key, eg `+=`
2023-10-02 12:28:02 -07:00
Peter Johanson
28ce23d489 chore(tests): Move to proper header name. 2023-09-16 11:52:40 -07:00
Peter Johanson
805dd4a53b feat(behaviors): Support parameterized macros.
* Add two new compatibles for macros that
  take one or two parameters when bound in
  a keymap.
* Use `&macro_param_1to1`, `&macro_param_1to2`, `&macro_param_2to1`,
  and `&macro_param_2to2` control entries in the bindings for the macro
  to have the next binding entry have it's values substituted.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2023-06-20 11:19:28 -06:00
Joel Spadin
94061bb916 refactor: Replace tabs with spaces
Standardized indentation to use spaces with a new pre-commit hook.
2023-04-24 16:07:04 -07:00
Joel Spadin
32ae776c42 refactor: Add more checks to pre-commit
Updated existing pre-commit hooks and added some new hooks:

- Remove trailing whitespace
- Ensure every non-empty file ends with a new line
- Check YAML file validity
- Prevent adding large files
- Ensure any scripts with shebangs are executable

Added a GitHub action to run pre-commit on every commit. Removed any
existing actions which duplicate pre-commit.

Ran pre-commit on the codebase.
2023-04-24 16:07:04 -07:00
nguyendown
702d79c108
test(behaviors): add unit tests for sticky key quick-release
Duplicate the existing tests with `quick-release` enabled:
- 8-lsk-osk-combination-quick-release
- 10-callum-mods-quick-release
2023-04-10 01:50:57 -04:00
Robert U
6cb42a8060
feat(behaviors): On-release option for positional-hold-taps 2023-03-12 12:24:00 -04:00
Joel Spadin
3eb06f137b feat: Add global macro timing configs
Added ZMK_MACRO_DEFAULT_WAIT_MS and ZMK_MACRO_DEFAULT_TAP_MS to set
global defaults for the wait-ms and tap-ms properties of macros.

Also reduced the default timings for macros, since it's been reported
many times that 100 ms is too slow.
2022-12-20 20:34:25 -06:00
Okke Formsma
a61eac9139
fix(behaviors): make tap dances work on a combo
* Tap dance event handler goes after combos
* Add test
2022-11-01 15:13:19 -05:00
Robert U
ef2e6e9156
feat(behaviors): Add mod-morph keep-mods
* Update docs for mod-morph
* Add unit tests for mod-morph
* Add keep-mods to DT binding

Co-authored-by: Martin Aumüller <aumuell@reserv.at>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2022-10-14 20:40:28 -05:00
Pete Johanson
fc511e40cc
fix(behaviors): Fixing erroneous combo triggering, hold-taps sticking
* This is a very simple fix to a rather complicated issue. Essentially,
hold-taps will "release" (raise) their captured keys before actually
telling the event manager they have captured a key. This means the event
manager ends up assigning the `last_listener_index` to the hold-tap
subscription rather than the combo. So when the combo calls
`ZMK_EVENT_RELEASE` it raises after the hold-tap instead of after the
combo as the combo code expects.
* The corresponding test (which fails without this change) has also been added.
* An event can be captured and released in the same event handler, before
the last_listener_index would have been updated. This causes some handlers
to be triggered multiple times.
* The solution is to update the last_listener_index before calling the next
event handler, so capturing and releasing within an event handler is harmless.
* Also see discussion at https://github.com/zmkfirmware/zmk/pull/1401
* If our handler dedides our undedided hold-tap,
  return early before continuing.
* Fix incorrect pointer logic, resulting in combo
  candidate filtering leaving incorrect timeout details.

Co-authored-by: Andrew Rae <ajrae.nv@gmail.com>
Co-authored-by: okke <okke@formsma.nl>
2022-08-03 20:09:50 -04:00
Peter Johanson
4af3d272fc fix(keymaps): Handle matching then-layers.
* Proporly handle multiple  conditonal layers w/ the same target
  `then-layer` values.
* Move handling to work callback, to avoid re-entrance for cascading
  layers enabling other layers.
2022-06-07 23:41:52 -04:00
Peter Johanson
b3c9c18fee feat(behaviors): Continue on mods in caps word.
* Continue caps word when mods are changed, and
  match the continue list on combination of
    explicit and implicit modifiers.
2022-06-04 01:38:42 -04:00
Caleb Goates
6dc436cb23 test(behavior): Add alt-tab test and modded alpha test for toggle key
Uses multiple toggles of modifier keys overlapping each other.
2022-06-03 00:04:41 -04:00
Caleb Goates
0d5bb100ba feat(behavior): Add key toggle 2022-06-03 00:04:41 -04:00
Peter Johanson
5b5b3ff2eb fix(tests): Fix hex formatting. 2022-05-19 10:55:23 -04:00
Peter Johanson
64dadfb336 refactor(tests): Move remaining tests to posix 64.
* Update docs and fix up a few lingering tests
  to consistently use native_posix_64 target.
2022-05-19 10:55:23 -04:00
Andrew Rae
b5efc7a7eb
feat(behaviors): Add global-quick-tap 2022-04-27 13:33:22 +01:00
Joel Spadin
6d6efa32f5 refactor(kscan): Auto enable kscan drivers
The key scanning drivers are now automatically enabled when a DT node
with the matching "compatible" property is present and enabled, so they
no longer need to be manually set for each board.
2022-04-25 22:28:53 -04:00
Peter Johanson
953f5212a8 refactor(tests): Move to native_posix_64 target.
* Allows removing multilib from docker images
* Run properly in aarch64 host docker
  containers for testing on Rasberry Pi.
* Small sticky-keys fix to initialize w/ correct
  constant for max uin32_t value.
2022-04-03 00:10:29 -04:00
Peter Johanson
8afe124153 fix(tests): Fix snapshots to account for formatting changes. 2022-04-03 00:10:29 -04:00
Peter Johanson
3a6a249ad0 feat(behaviors): Add macro support.
* Fine grainted press/release/tap actions.
* TIming between actions can be controlled.
* Processed async, to avoid blocking.
2022-03-23 23:42:54 -04:00
Kurtis Lew
32ebe2cfb5
feat(behaviors): Add Tap-Dance behavior 2022-03-16 01:08:42 -04:00
okke
ad5a12a7bc fix(behaviors): Fix bug in nested sticky keys
If multiple sticky keys with quick release were nested, only the first one
was properly released. This fix makes sure all of them are released properly.

Fixes https://github.com/zmkfirmware/zmk/issues/1149
2022-03-15 23:04:45 -04:00
okke
cfd0d3d81a Behaviors: Add 'ignore-modifiers' option to sticky keys
To combine multiple sticky modifiers, the sticky keys must ignore
other (sticky) modifier keypresses.

This behavior is important for "callum-style mods", where all modifiers
are sticky mods.

Fixes #829
2022-02-07 14:45:07 -05:00
Alessandro Bortolin
13a4515300 feat(backlight): add command to cycle brightness 2022-02-05 23:40:18 -05:00