Skip to content

Clear keys with a middle click - #153

Open
Glitchy-Sheep wants to merge 3 commits into
ergohaven:mainfrom
Glitchy-Sheep:feat/middle-click-clear-key
Open

Clear keys with a middle click#153
Glitchy-Sheep wants to merge 3 commits into
ergohaven:mainfrom
Glitchy-Sheep:feat/middle-click-clear-key

Conversation

@Glitchy-Sheep

@Glitchy-Sheep Glitchy-Sheep commented Aug 16, 2026

Copy link
Copy Markdown

❓ Problem

Clearing one key takes three steps:

  1. open the picker
  2. switch to the Special tab
  3. choose None.

Emptying a group of keys means repeating that for every key, and the picker reopens each time.

This hurts most when reworking a layer for new functionality.
It's a lot of actions just to clean everything up (it could be a better UX for this).

Middle click had no meaning anywhere in the app, so it was free to use for this.

✅ Fix (what have I done)

  • Middle click on a key or an encoder slot writes None (KC_NO) to the device without opening the picker.
  • Clicks made while an earlier write is still running are queued, so fast repeated clearing does not drop any of them.
  • A click on a key that is already empty does nothing: no write and no undo step.
  • Each clear is its own undo step, so Ctrl+Z brings the keys back one by one.
  • Clearing reuses the existing key write path, so RMK boards get the same write with readback that the picker already uses.
  • When two edits target the same key, the newest one wins. A clear cancels a picker result that has not been written yet, and a handed swap waiting for Ctrl release. A layer write (paste, fill, undo) cancels clears queued for that layer.
  • The bottom hint bar shows Middle click to clear this key while a key with a binding is hovered, and the onboarding tour text mentions the gesture.

🎦 Demo

I tested it out on my K:04, there is how it looks like (before / after):

2026-08-17 AT 01 30

Middle click on a layout key or encoder slot writes KC_NO directly,
without opening the picker. Clicks made while another HID write is in
flight are queued and applied in order, so rapid bulk clearing does not
lose clicks. A clear supersedes older deferred edits of the same key
(parked picker result, pending handed swap) and vice versa. The bottom
hint bar and the onboarding tour mention the new gesture.
A whole-layer write (paste, fill, undo) is a newer user action than a
middle-click clear still waiting for the HID handle. Drop queued clears
for that layer so a stale clear cannot land on a key the layer write
just set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant