Skip to content

Commit

Permalink
docs: Document behavior name length limit
Browse files Browse the repository at this point in the history
Added a section to the new behavior guide to document that the names of
behaviors invoked on the peripheral side of a split must be at most 8
characters long.
  • Loading branch information
joelspadin committed Dec 5, 2023
1 parent 23ecf08 commit 0fd8e25
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/docs/development/new-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,20 @@ For the purpose of this section, we will discuss the structure of `app/dts/behav
};
```

The format of a behavior's `.dtsi` file is identical to declaring an instance of the behavior in a user's keymap. The only major difference is that the value `/omit-if-no-ref/` should be placed adjacent to the name of the behavior, as seen in line 11 of the `gresc` example.
The format of a behavior's `.dtsi` file is identical to declaring an instance of the behavior in a user's keymap. The only major difference is that the value `/omit-if-no-ref/` should be placed adjacent to the label and name of the behavior, as seen in line 11 of the `gresc` example.

:::caution

If your behavior has its [`locality`](#api-structure) property set to anything other than `BEHAVIOR_LOCALITY_CENTRAL`, then the name of the node must be at most 8 characters long, or it will fail to be invoked on the peripheral half of a split keyboard.

In the above example, `grave_escape` is too long, so it would need to be shortened, e.g.

```dts
// Behavior can be invoked on peripherals, so name must be <= 8 characters.
/omit-if-no-ref/ gresc: gresc { ... };
```

:::

After creating the `.dtsi` from above, update `app/dts/behaviors.dtsi` to include your newly predefined behavior instance, making it accessible by the devicetree.

Expand Down

0 comments on commit 0fd8e25

Please sign in to comment.