Commit Graph

29 Commits

Author SHA1 Message Date
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 4df83a9c0d refactor: Move away from deprecated PM callback. 2022-04-03 00:10:29 -04:00
Peter Johanson 2c5d5fde51 refactor: `k_work_queue` API updates. 2022-04-03 00:10:29 -04:00
Peter Johanson 40d8470664 refactor: Handle HID macro/API changes in Zephyr. 2022-04-03 00:10:29 -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
Pete Johanson 2a69f31eb0 refactor(core): Move away from deprecated DT API.
* Move to `DEVICE_DT_INST_DEFINE` everywhere.

See: https://docs.zephyrproject.org/2.5.0/releases/release-notes-2.5.html#deprecated-in-this-release
PR: https://github.com/zmkfirmware/zmk/pull/736
2021-07-17 17:04:25 -04:00
Okke Formsma de4979bf58 fix(behaviors): Fix sticky keys quick-release for normal keypresses
Quick release for sticky keys failed for non-layer keys. The sticky key
was released just before the key that was supposed to be modified was
handled.

The issue was caused by an error in the sticky key logic, which released
the sticky key before handling the key up event.

Fixes #696.
2021-05-09 07:52:41 -04:00
Okke Formsma 84d19fe79b refactor(behaviors): factor out multiple uses of _TRANSFORM_ENTRY 2021-02-02 00:43:26 -05:00
Okke Formsma c925cf02dd feature(sticky_keys): add quick-release
when quick-release is enabled, the sticky key is released immediately after another key is pressed
2021-01-28 17:10:04 -05:00
Pete Johanson 3368a81057 refactor(core): Combine `is_` and `cast_` event functions.
* Use a single `as_foo` generated function to conditionally
  return a certain event type from a generic `zmk_event_t*`
  pointer.
2021-01-20 07:06:11 -05:00
Pete Johanson 3fe2acc2d1 refactor(core): Extra event payloads to own types, refactor API.
* Make it easier to use *just* event payloads by defining the data,
  and then having event manager macros generate "wrapper structs"
* Improve is_*/cast_* APIs to hide details of full event struct.
* Create `zmk_event_t` typedef to pass to event handlers.
* Bring event names inline w/ consistent `zmk_` prefix.
2021-01-20 07:06:11 -05:00
Okke Formsma fa07ba9d32 refactor(behaviors): use ZMK_BEHAVIOR_OPAQUE and ZMK_BEHAVIOR_TRANSPARENT
Use these instead of the magic return values 0 and 1 for
behavior_driver_api return values.
2021-01-01 23:07:54 -05:00
Okke Formsma caa285852a refactor(events): return 'ZMK_EV_EVENT_BUBBLE' instead of magic number 0 2021-01-01 23:07:54 -05:00
innovaker 842aa5a842 refactor: replace filename hyphens with underscores
Aligns *.h and *.c to underscore naming convention.

These were kept (with warnings) for backwards compatibility with external boards/shields:
- kscan-mock.h
- matrix-transform.h
They should be removed in the future.

PR: #523
2020-12-28 01:15:35 -05:00
innovaker 89532eadeb fix(sticky keys): add 0xFF mask to usage_page
Aligns unpacking of usage_page with its equivalent line in keycode-state-changed.h

PR: #520
2020-12-17 16:52:15 -05:00
Okke Formsma b115f16f4c refactor(sticky keys): use DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) instead of DT_NODE_EXISTS(DT_DRV_INST(0)) 2020-12-15 13:59:03 -05:00
Okke Formsma 1c2796d1c9 refactor(sticky keys): use pointer to avoid repetition in store_sticky_key 2020-12-15 13:59:03 -05:00
Okke Formsma bc8803ba50 refactor(sticky keys): rename ZMK_BHV_STICKY_KEY_POSITION_NOT_USED to ZMK_BHV_STICKY_KEY_POSITION_FREE 2020-12-15 13:59:03 -05:00
Okke Formsma 26af11b390 refactor(sticky keys): rename timer_is_started to timer_started 2020-12-15 13:59:03 -05:00
innovaker 00ca0d2f1c refactor(app): replace `struct device *` with `const struct device *`
Replaced with RegExp: /(?<!const )(struct device \*)/g

See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html
PR: #467
2020-12-14 12:41:25 -05:00
innovaker 3d7376d2e5 refactor(app): replace `config_info` with `config`
See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html
PR: #467
2020-12-14 12:41:25 -05:00
innovaker bac1f17cf6 refactor(app): replace Zephyr integer types with C99 integer types
u8_t → uint8_t
u16_t → uint16_t
u32_t → uint32_t
u64_t → uint64_t
s8_t → int8_t
s16_t → int16_t
s32_t → int32_t
s64_t → int64_t

Prerequisite for #223
See: https://github.com/zephyrproject-rtos/zephyr/releases/tag/zephyr-v2.4.0
PR: #467
2020-12-14 12:41:25 -05:00
Okke Formsma e00eceb508 fix(sticky keys): fix tapping-sticky-keys bug.
Sticky keys should be cleared when they were tapped in rapid succession before the timer runs out.
2020-12-06 00:33:20 -05:00
Okke Formsma f86e0fff14 fix(sticky keys): always clear sticky key when releasing the behavior 2020-12-06 00:33:20 -05:00
Okke Formsma 2ba16c2f3d fix(sticky keys): use correct timestamp when clearing sticky key in timer 2020-12-06 00:33:20 -05:00
Okke Formsma 37946ff57b fix(sticky keys): simplify timer management 2020-12-06 00:33:20 -05:00
Okke Formsma 3bf770a364 bugfix(sticky keys): release active sticky keys properly
see https://github.com/zmkfirmware/zmk/issues/445
2020-11-29 20:16:51 -05:00
Okke Formsma 76a6d7b4c5 feat(sticky keys): initial implementation 2020-11-28 00:58:24 -05:00