From a5c31aaef78e575eb33b089cbaea0a0ebe988338 Mon Sep 17 00:00:00 2001 From: felixzsh Date: Tue, 11 Aug 2026 16:23:00 -0500 Subject: [PATCH] lingerMs 0 keeps the last combo on screen until the next key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hide timer only starts (and only clears) when lingerMs > 0, so 0 means the last full combo stays visible until the next key replaces it — the keyviz-video look, as an explicit opt-in rather than the previous behavior where 0 hid instantly. --- KeyVisualizer.qml | 10 +++++++--- README.md | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/KeyVisualizer.qml b/KeyVisualizer.qml index 982f7e3..14a3bac 100644 --- a/KeyVisualizer.qml +++ b/KeyVisualizer.qml @@ -23,7 +23,8 @@ Item { property var keys: [] // How long the last combination stays on screen after the keys are // released (keyviz's "Duration"; keyviz defaults to 5000ms). The combo - // lingers intact, then vanishes in one frame — no fade. + // lingers intact, then vanishes in one frame — no fade. 0 means "always + // show": the last combo stays until the next key replaces it. property int lingerMs: 1000 // Drop state written more than this long ago (e.g. from a previous shell // session after a restart) so a stale combo never sticks on screen. @@ -122,8 +123,10 @@ Item { } if (next.length === 0) { // Keys were released: keep the last combo on screen for the linger - // window, then clear it. A fresh press restarts the timer below. - hideTimer.restart() + // window, then clear it. lingerMs 0 means "always show": the last + // combo stays until the next key replaces it. + if (root.lingerMs > 0) hideTimer.restart() + else hideTimer.stop() } else { hideTimer.stop() root.keys = next @@ -135,6 +138,7 @@ Item { id: hideTimer interval: root.lingerMs onTriggered: { + if (root.lingerMs <= 0) return // always-show mode never auto-clears root.keys = [] root.opened = false } diff --git a/README.md b/README.md index fcdf6ba..82f7560 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,8 @@ plugin, not just this one. - After the last key is released the combo lingers briefly (1s by default, keyviz-style "Duration") and then vanishes in one frame — no fade. The lingering combo is always the last full one, never a partial release state. + `lingerMs: 0` means "always show": the last combo stays on screen until + the next key replaces it. - In `mode: "bindings"` only combos with a modifier are shown; plain typing stays off screen. @@ -141,7 +143,7 @@ the plugin on every edit. Editing this file updates the display live: | `mode` | `all` or `bindings` (only combos with a modifier) | `all` | | `position` | any of the nine: `top-left` … `bottom-right`, plus `center` | `bottom-center` | | `margin` | px from the screen edge | `67` | -| `lingerMs` | ms a released combo stays (keyviz defaults to `5000`) | `1000` | +| `lingerMs` | ms a released combo stays; `0` keeps it until the next key (keyviz defaults to `5000`) | `1000` | Deeper tweaks still live in the QML/Lua sources: