zmk-studio icon indicating copy to clipboard operation
zmk-studio copied to clipboard

Generate Short Labels for Keys with Behaviors that don't have HID Code set as first Param

Open aziddy opened this issue 5 months ago • 2 comments

The un-hovered boxes showing nothing bothers me alot. This method isn't ideal either, but it shows that something is atleast populated on the key

  1. Still Checks for label from hid_usage prop and renders the same as before this PR
  2. If no label exists (either HID Code not in hid-usage-name-overrides.json or just not a HID Code) it will start using the behavior name provided by the added behavior_name prop to generate a short label
  3. First use "_" & "-" as delimiters between sections, grabs first letter between sections upto 3
  4. If "_" & "-" are not present, uses first 3 letters of behavior name instead

Works with custom behaviors too (pictured)

Layer 2 - Shift It BLU BLU

aziddy avatar Jun 23 '25 16:06 aziddy

Deploy Preview for zmk-studio ready!

Name Link
Latest commit bfb024842372543aac74bfdf7b51aef07ffe5365
Latest deploy log https://app.netlify.com/projects/zmk-studio/deploys/685980c67f47dd00085cab73
Deploy Preview https://deploy-preview-143.preview.zmk.studio
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 23 '25 16:06 netlify[bot]

Thanks a lot, this is exactly what I need! Maybe we could display a blank for the following two cases:

  1. When the content is _Trans (shows as T, same as the letter T);
  2. When the content is unknown (shows as UNK).
image

atever avatar Oct 20 '25 09:10 atever