Commit Graph

16 Commits

Author SHA1 Message Date
Okke Formsma 57fca34dc0 refactor(hid): Move hid logic into hid.c
Move the logic for picking the correct hid function into hid.c.
2022-06-03 00:04:41 -04:00
Peter Johanson 6ef1e7034f fix(hid): Implicit mods on non-key page events
* Properly send the KEY usage page report for modifier changes
  when there are state changes to other usages pages that
  include implicit modifiers.
2021-12-02 07:18:25 -05:00
Okke Formsma 7b7701ae90 feature(modifiers): add explicit modifiers
this makes LS(LEFT_CONTROL) work as if shift and control were both
pressed explicitly. Previously, the left shift would have been released
as soon as another key was pressed. The implicit behavior is useful in
case of LS(NUMBER_1) when rolling over to other keys.

Also see #361.
2021-01-24 23:30:41 -05:00
Okke Formsma df4a5c8613 refactor(hid_listener): pass event struct instead of parameters 2021-01-24 23:30:41 -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
innovaker 1d18900a99 refactor(core): define usage page as uint16_t
Aligns with the HID specification.

Usage page values were sometimes declared as uint8_t and sometimes uint16_t.  This commit aligns all instances with the HID specification for consistency.

PR: #521
2021-01-15 01:48:39 -05:00
innovaker 87e7c04b00 refactor(app): replace zmk_mod_flags with zmk_mod_flags_t
Aligns with typedef _t convention.

PR: #531
2020-12-28 10:20:12 -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 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
innovaker 3ac1a11a37 refactor: change `keypad` to `keyboard`
The application usage used by report 1 is `HID_USAGE_GD_KEYBOARD`.  Moreover, the `keys` usage page (0x07) that primarily feeds into this report is predominantly keyboard codes.  The rest of the system should align with this naming convention.
2020-11-21 15:52:16 -05:00
innovaker e925319e4c refactor(hid): Replace deprecated HID usage page references
Deprecate `USAGE_KEYPAD` and replace with `HID_USAGE_KEY`.

Deprecate `USAGE_CONSUMER` and replace with `HID_USAGE_CONSUMER`.

Closes #217.
2020-11-03 23:50:54 -05:00
Okke Formsma 4f258efbf1 initial implementation for modifiers
https://github.com/zmkfirmware/zmk/issues/86
2020-11-03 00:19:37 -05:00
Pete Johanson 191a2d755a chore: clang-format the codebase.
* Use the LLVM style
* Override indent width (8) and column limit (100)
* Fixes #142.
2020-09-14 00:10:34 -04:00
Pete Johanson 68e72f9275 fix: Switch to single AUTHORS file.* Closes #164 2020-09-10 10:24:23 -04:00
Pete Johanson 57e061ac91 Lots of cleanup of old events/behavior mash. 2020-06-30 15:21:42 -04:00
Renamed from app/src/behaviors/behavior_hid.c (Browse further)