Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio: keymap subsystem #2268

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

petejohanson
Copy link
Contributor

This PR is layered on top of #2254 showing how this will be evolving for the keymap subsystem.

Core features:

  • Adds a new "settings storage" option for keymaps for saving/restoring keymap bindings using the Zephyr settings subsystem.

Adds a new keymap subsystem that:

  • Fetches the current keymap
  • Allows setting the behavior binding (behavior + params) for a given key position in the keymap.
  • Positions with unsaved changes to the keymap are tracked.
  • Adds save and discard changes requests that will save the changed bindings to settings subsystem, or in the case of "discard" will simply reload the bindings all from settings subsystem.

Leaving this as a draft PR for now pending review of #2231 and #2254

@petejohanson petejohanson added enhancement New feature or request keymaps PRs and issues related to keymaps studio ZMK Studio (runtime keymaps) labels Apr 12, 2024
@petejohanson petejohanson self-assigned this Apr 12, 2024
@petejohanson petejohanson linked an issue Apr 12, 2024 that may be closed by this pull request
@petejohanson petejohanson force-pushed the studio/keymap-subsystem branch 2 times, most recently from 8c11546 to 6bcad3e Compare April 18, 2024 05:40
* For upcoming ZMK studio work, make a set of rich metadata available
  to provide a friendly name for a behavior, and allow super flexible
  descriptions of the parameters the behaviors take.
* Used for ZMK Studio even remappers to be sure the one
  RPC event listener subscribes to their mapped events.
* Add a new feature for tracking a given behavior by a new concept
  of a "behavior local ID" which is a stable 16-bit identifier for
  a given behavior, that is resilient to new behaviors being added
  and requires no additional work on the part of the behavior
  authors.
* Add implementations for either settings lookup table, or CRC16
  hashing of behavior device names for generating behavior local
  IDs.
@petejohanson petejohanson force-pushed the studio/keymap-subsystem branch 4 times, most recently from ba1f1d1 to 66157f1 Compare April 22, 2024 08:46
@petejohanson petejohanson force-pushed the studio/keymap-subsystem branch 2 times, most recently from b210f56 to 7656aa8 Compare May 17, 2024 08:56
* UART and BLE/GATT transports for a protobuf encoded RPC
  request/response protocol.
* Custom framing protocol is used to frame a give message.
* Requests/responses are divided into major "subsystems" which
  handle requests and create response messages.
* Notification support, including mapping local events to RPC
  notifications by a given subsystem.
* Meta responses for "no response" and "unlock needed".
* Initial basic lock state support in a new core section, and allow specifying
  if a given RPC callback requires unlocked state or not.
* Add behavior subsystem with full metadata support and examples of
  using callback to serialize a repeated field without extra stack space needed.
 * Add an easy snippet for enabling USB UART added
   to the `zephyr_udc0` standard node.
* Implement message framing.
* Transports over Web Bluetooth/Serial.
* Message types for serialize/deserialize generated with protoc.
* Add ability to validate a zmk_behavior_binding against
  the behavior metadata available.
* Add keymap API for getting/setting a bindings
  in keymap layers.
* Add settings storage for keymap layer bindings.
* Add APIs for fetching the current keymap, and updating a particular
  binding in a layer of the keymap, including validation of parameters.
* Add API for savings/discarding keymap changes.
* Add bindings to allow creating multiple physical layouts that specify
  their key's physical attributes, and the matching matrix transform
  and dependant kscan to use.
* Synthesize a basic physical layout if none specified, for backwards
  compatibility.
* Update matrix transform API to explicitly pass in the selected transform
  to the API instead of using a fixed chosen transform.
* Move kscan subscription and handling into the physical layout code, so
  that selecting a different physical layout at runtime can also use the
  correct kscan instance.
* Add `physical_layouts.dtsi` file to include so you can use the
  pre-configured `&key_physical_attrs` for adding you layout keys.
* Update our GPIO kscan drivers to more completely support PM device,
  by doing proper hardare init/deinit in the PM action hook.
* Add physical layout definitions for uno and split uno shields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keymaps PRs and issues related to keymaps studio ZMK Studio (runtime keymaps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keymap loading/persisting to settings subsystem
1 participant