lingerMs 0 keeps the last combo on screen until the next key
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.
This commit is contained in:
+7
-3
@@ -23,7 +23,8 @@ Item {
|
|||||||
property var keys: []
|
property var keys: []
|
||||||
// How long the last combination stays on screen after the keys are
|
// How long the last combination stays on screen after the keys are
|
||||||
// released (keyviz's "Duration"; keyviz defaults to 5000ms). The combo
|
// 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
|
property int lingerMs: 1000
|
||||||
// Drop state written more than this long ago (e.g. from a previous shell
|
// 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.
|
// session after a restart) so a stale combo never sticks on screen.
|
||||||
@@ -122,8 +123,10 @@ Item {
|
|||||||
}
|
}
|
||||||
if (next.length === 0) {
|
if (next.length === 0) {
|
||||||
// Keys were released: keep the last combo on screen for the linger
|
// Keys were released: keep the last combo on screen for the linger
|
||||||
// window, then clear it. A fresh press restarts the timer below.
|
// window, then clear it. lingerMs 0 means "always show": the last
|
||||||
hideTimer.restart()
|
// combo stays until the next key replaces it.
|
||||||
|
if (root.lingerMs > 0) hideTimer.restart()
|
||||||
|
else hideTimer.stop()
|
||||||
} else {
|
} else {
|
||||||
hideTimer.stop()
|
hideTimer.stop()
|
||||||
root.keys = next
|
root.keys = next
|
||||||
@@ -135,6 +138,7 @@ Item {
|
|||||||
id: hideTimer
|
id: hideTimer
|
||||||
interval: root.lingerMs
|
interval: root.lingerMs
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
if (root.lingerMs <= 0) return // always-show mode never auto-clears
|
||||||
root.keys = []
|
root.keys = []
|
||||||
root.opened = false
|
root.opened = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ plugin, not just this one.
|
|||||||
- After the last key is released the combo lingers briefly (1s by default,
|
- 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
|
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.
|
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
|
- In `mode: "bindings"` only combos with a modifier are shown; plain typing
|
||||||
stays off screen.
|
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` |
|
| `mode` | `all` or `bindings` (only combos with a modifier) | `all` |
|
||||||
| `position` | any of the nine: `top-left` … `bottom-right`, plus `center` | `bottom-center` |
|
| `position` | any of the nine: `top-left` … `bottom-right`, plus `center` | `bottom-center` |
|
||||||
| `margin` | px from the screen edge | `67` |
|
| `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:
|
Deeper tweaks still live in the QML/Lua sources:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user