Commit Graph

116 Commits

Author SHA1 Message Date
Horu
7d1f84e3eb
chore: fix typos in various places 2024-05-13 16:47:33 -04:00
German Gutierrez
d1ad34761a
fix: shortening keymap_soft_off behavior node
* Shorten the soft off node in order for it to work across splits.
2024-04-29 12:22:40 -04:00
Peter Johanson
7e7110d85f fix(pm): Fixes for dedicated on/off on peripherals.
* Add new flag to differentiate soft off on peripherals that
  is invoked by split GATT svc and dedicated additional ones
  tied to GPIO pin.
2024-03-27 20:59:26 -07:00
Peter Johanson
5d960a758f fix: Cleanups of sideband and direct kscan from review.
* Add dedicated init priority for the sideband kscan.
* Refactor sideband code for clarity.
* Tweaks to direct kscan for clarity.
* Make sideband behavior row optional for brevity.
* Allow overriding ZMK Uno sideband behaviors.
2024-03-27 20:59:26 -07:00
Peter Johanson
4198fac90f fix(pm): Fix deep sleep with sideband behaviors.
* Properly implement the PM hook needed for sideband behavior
  kscan device to have wakeup source enabled on it.
2024-03-27 20:59:26 -07:00
Peter Johanson
a0ad1d4c94 refactor: Add kscan sideband behavior driver
* Instead of gpio key behavior trigger, add new kscan driver that
  decorates/wraps a given kscan driver and will invoke basic system
  behavior assigned to a given row + column, without the need for keymap
  mapping in the matrix transform, bypassing keymaps entirely.
2024-03-27 20:59:26 -07:00
Pete Johanson
933fdcd364 refactor(pm): Remove scanned behavior trigger.
* Remove the painful scanned behavior trigger for now, future enhancement
  will restore this high level functionality using kscan directly.
2024-03-27 20:59:26 -07:00
Peter Johanson
fceb0351a5 refactor: Fixes for soft-off based on review.
* Better naming for gpio-key behavior triggers.
* Tweaks to scanned behavior trigger to avoid bad semaphore use,
  and reduce chance of issues with slowly scanned matrixes.
* Various code cleanups of style issues.
2024-03-27 20:59:26 -07:00
Peter Johanson
e78249ee06 fix(bt): Fix BT tests after soft off work.
* Move to explicit enable of `ZMK_PM_SOFT_OFF` to turn
  on the feature and use the behaviors, which matches
  how other features work, and helps with split and
  testing schemes.
2024-03-27 20:59:26 -07:00
Peter Johanson
b19df0cbf0 feat(behaviors): Add soft off behavior.
* New soft-off behavior that can be used to force the device
  into  soft-off state with only certain configured wakeup
  devices.
2024-03-27 20:59:26 -07:00
Peter Johanson
adb3a13dc5 feat: Add soft on/off support.
Initial work on a soft on/off support for ZMK. Triggering soft off
puts the device into deep sleep with only a specific GPIO pin
configured to wake the device, avoiding waking from other key
presses in the matrix like the normal deep sleep.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2024-03-27 20:59:26 -07:00
Theo Lemay
341534aa15 feat(behaviors): lazy sticky keys 2024-03-18 10:30:14 -07:00
Theo Lemay
c007d60357 feat(behaviors): hold while undecided 2024-02-20 00:25:53 -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
d4e8dee444 refactor(keymaps): Rename layer label to "display-name"
Changed the property used to define a layer name for displays from
"label" (which affects other things in Zephyr and is deprecated) to
"display-name". (It cannot be named simply "name", because that has
special meaning in newer versions of the devicetree compiler.)

"label" is still supported as a fallback, so no changes need to be made
to existing keymaps.
2023-12-04 20:06:54 -06:00
Joel Spadin
05925c72d7 refactor(ext_power): Remove label property
Changed the label property on zmk,ext-power-generic to be optional and
removed it from existing uses. Renamed the nodes for all non-development
boards to "EXT_POWER" to preserve user settings.

rgb_underglow.c now finds the correct device by finding the first
instance of zmk,ext-power-generic instead of looking for a node named
"EXT_POWER".
2023-12-04 20:06:54 -06:00
Joel Spadin
179bdbc41a refactor(behaviors): Make label property optional
Changed all code (except for layer names) which used the label property
to use DEVICE_DT_NAME() instead, which uses the label if set or falls
back to the full node name. This matches how Zephyr determines the node
names used with device_get_binding() and allows us to start removing the
deprecated label property from things.
2023-12-04 20:06:54 -06: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
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
Peter Johanson
690bc1bb44 refactor: Move drivers into properly module.
* Align our driver module layout to properly match Zephyr conventions,
  allowing proper CMake setup to amend the library for each type of driver.
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
Peter Johanson
2244bd3d81 refactor(sensors): Sensor event channel data, resolution tweaks.
* Refactor sensor events to include channel data,
  necessary for prop split encoders, and avoiding duplicate calls,
  to fetch channel data twice, etc.
* More consistent behavior driver API.
* Allow setting triggers per resolution at the behavior level optionally.
2023-06-18 20:45:06 -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
Nick Conway
3db163aa2c feat(behaviors): Add reusable sensor behaviors.
* Add new sensor behaviors that either take full bindings
  add definition, or accept parameters when bound in the
  keymap.
* Remove existing hard-coded key press sensor behavior
  and instead leverage new generic sensor behaviors to
  achieve the same functionality.

Co-authored-by: nick@conway.dev
2023-04-21 21:13:31 -07:00
Peter Johanson
35a1c5a3d4 refactor(behaviors): Rename reset behavior.
* Upstream now has a node w/ label `reset` on many boards, so
  renaming our reset behavior node label to `sys_reset`.
2023-04-05 22:55:38 -07:00
Robert U
6cb42a8060
feat(behaviors): On-release option for positional-hold-taps 2023-03-12 12:24:00 -04:00
Nick Coutsos
6e99a48696 fix(behaviors): Mark sticky key release-after-ms required 2022-12-20 20:38:26 -06: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
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
Nick Conway
edec4595ae fix(behaviors): Fix mod morph description 2022-07-03 09:11:00 -04:00
Peter Johanson
1e8224c296 feat(behaviors): Add DEL/BSPC to continue list.
* Continue caps word on delete/backspace by
  default now.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2022-06-04 01:38:42 -04:00
Caleb Goates
0d5bb100ba feat(behavior): Add key toggle 2022-06-03 00:04:41 -04:00
Andrew Rae
b5efc7a7eb
feat(behaviors): Add global-quick-tap 2022-04-27 13:33:22 +01:00
Peter Johanson
f4fb5c6fba fix(build): Add local vendor prefix file.
Properly document `zmk` local vendor prefix.
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
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
ce843825e8 refactor(backlight): code cleanup 2022-02-05 23:40:18 -05:00
ReFil
5614a8bb80 feat(backlight): initial split support 2022-02-05 23:40:18 -05:00
Alessandro Bortolin
85b2d30bd5 feat(lighting): add backlight behavior 2022-02-05 23:40:18 -05:00
Peter Johanson
4d55e60adb refactor(behaviors): Always add reset behaviors.
* Don'd omit unreferenced reset behaviors, so they are always
  available in split peripherals.
2022-01-31 23:03:34 -05:00
Peter Johanson
e8540f17fc fix: Ensure power and underglow behaviors built.
* Remove `/omit-if-no-ref/` from the behavior nodes.
2022-01-31 23:03:34 -05:00
Pete Johanson
47f873b038 feature(split): behavior locality support.
* GATT characteristic allowing passng data + behavior
  label to invoke the behavior on the peripheral side.
* Behaviors have a locality setting to specify where they run.
* Build reset/power/RGB on peripheral.
2022-01-31 23:03:34 -05:00
Peter Johanson
70bb7c9334 feat(behaviors): &key_repeat behavior + tests.
* Add new `&key_repeat` behavior that captures and re-sends
  the most recently triggered keycode.

Closes: #853
2022-01-30 22:47:34 -05:00
Lucas Yunkyu Lee
2666bd622c fix(keymaps): add row-offset property to matrix-transform 2021-12-20 06:14:35 -05:00