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

feat(docs): Update behaviors config page #2055

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

caksoylar
Copy link
Contributor

This PR updates the behaviors config page to do the following, split into separate commits:

  • Add a couple missing links to behavior docs
  • Fix #binding-cells for sticky keys to <1>
  • Add missing definition file links for parametrized macro variants
  • Add sensor rotation behaviors that were missing
  • Note how behaviors forward the parameters they receive to the behaviors they invoke

Mouse key press behavior is not documented here, but similar to key press, it has no options to tweak so IMO it doesn't seem necessary. However move/scroll behaviors will likely need to be documented in the future.

@caksoylar caksoylar added the documentation Improvements or additions to documentation label Dec 4, 2023
@caksoylar caksoylar requested a review from joelspadin December 4, 2023 07:41
Comment on lines 135 to 134
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro.yaml),
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro-one-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-one-param.yaml),
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro-two-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-two-param.yaml)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but it all kinda blends in to one long string of blue text. Maybe formatting it as a list would look better?

Suggested change
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro.yaml),
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro-one-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-one-param.yaml),
[zmk/app/dts/bindings/behaviors/zmk,behavior-macro-two-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-two-param.yaml)
- [zmk/app/dts/bindings/behaviors/zmk,behavior-macro.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro.yaml)
- [zmk/app/dts/bindings/behaviors/zmk,behavior-macro-one-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-one-param.yaml)
- [zmk/app/dts/bindings/behaviors/zmk,behavior-macro-two-param.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-macro-two-param.yaml)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I had thought about it but hadn't made a decision, I changed it now.

Comment on lines 204 to 200
[zmk/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-sensor-rotate.yaml),
[zmk/app/dts/bindings/behaviors/zmk,behavior-sensor-rotate-var.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/behaviors/zmk%2Cbehavior-sensor-rotate-var.yaml)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `label` | string | Unique label for the node | |
| `compatible` | string | Sensor rotation type, **must be _one_ of**:<br/>• `"zmk,behavior-sensor-rotate"`<br/>• `"zmk,behavior-sensor-rotate-var"` | |
| `#sensor-binding-cells` | int | Number of params accepted (depends on `compatible` property), **must be _one_ of**:<br/>• `<0>`<br/>• `<2>` | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written like this, it's not very clear how they depend on the compatible property.

Suggested change
| `#sensor-binding-cells` | int | Number of params accepted (depends on `compatible` property), **must be _one_ of**:<br/>• `<0>`<br/>• `<2>` | |
| `#sensor-binding-cells` | int | Must be <ul><li>`<0>` if `compatible = "zmk,behavior-sensor-rotate"</li><li>`<2>` if `compatible = "zmk,behavior-sensor-rotate-var"`</li></ul> | |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearer indeed, thanks!

| Property | Type | Description | Default |
| ----------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `label` | string | Unique label for the node | |
| `compatible` | string | Sensor rotation type, **must be _one_ of**:<br/>• `"zmk,behavior-sensor-rotate"`<br/>• `"zmk,behavior-sensor-rotate-var"` | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use <ul> and <li> tags instead of <br> and bullet characters to get an actual list here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also modified this, I had copied from macros without thinking about it much.

@caksoylar caksoylar force-pushed the docs/update-behaviors-config branch from 170aad3 to f2c3153 Compare December 5, 2023 19:29
@caksoylar caksoylar force-pushed the docs/update-behaviors-config branch from f2c3153 to 3e4aca1 Compare December 5, 2023 22:15
@caksoylar caksoylar requested a review from joelspadin December 5, 2023 22:19
@caksoylar caksoylar merged commit 09d47d8 into zmkfirmware:main Dec 7, 2023
6 checks passed
@caksoylar caksoylar deleted the docs/update-behaviors-config branch December 7, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants