fix: drop modifier-only chords from the history
Releasing a chord made only of modifiers (Super, Super Ctrl Shift...) is 'mods of nothing': it scores nothing in combo mode and now no longer lingers or occupies a history row either. The mods still show live while held, which is the useful feedback; on release the entry is removed instantly instead of entering its linger window.
This commit is contained in:
@@ -361,9 +361,17 @@ Item {
|
|||||||
// once here (never on the intermediate growing emits).
|
// once here (never on the intermediate growing emits).
|
||||||
if (es.length > 0 && es[0].releasedAt === 0) {
|
if (es.length > 0 && es[0].releasedAt === 0) {
|
||||||
var completed = es[0].keys.slice()
|
var completed = es[0].keys.slice()
|
||||||
|
// A chord made only of modifiers is "mods of nothing": it scores
|
||||||
|
// nothing, so it must not linger or occupy a history row either.
|
||||||
|
// Drop it the moment the keys go up (it still shows live while
|
||||||
|
// held, which is the useful feedback).
|
||||||
|
if (root.modCountOf(completed) >= completed.length) {
|
||||||
|
es.shift()
|
||||||
|
} else {
|
||||||
es[0] = { keys: es[0].keys, releasedAt: Date.now() }
|
es[0] = { keys: es[0].keys, releasedAt: Date.now() }
|
||||||
root.pressCombo(completed)
|
root.pressCombo(completed)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (es.length > 0 && root.sameKeys(es[0].keys, next)) {
|
} else if (es.length > 0 && root.sameKeys(es[0].keys, next)) {
|
||||||
// Same combo re-pressed (or the state file re-fired): refresh it,
|
// Same combo re-pressed (or the state file re-fired): refresh it,
|
||||||
// no duplicate history entry.
|
// no duplicate history entry.
|
||||||
|
|||||||
Reference in New Issue
Block a user