feat: compound chording actions

This commit is contained in:
2023-12-06 01:19:01 +01:00
parent 1d53f6df7a
commit 846183bbb1
5 changed files with 35 additions and 21 deletions

View File

@@ -51,3 +51,11 @@ actions:
id: "RELEASE_KEYS"
title: Release all keys, but not keyboard modifiers
icon: text_rotate_up
523:
id: "PRESS_NEXT"
title: "Press and do not release the next key/action"
icon: download
524:
id: "RELEASE_NEXT"
title: "Release the next key/action in the sequence"
icon: upload

View File

@@ -62,15 +62,13 @@ for (const icon of icons) {
.flatMap(it => [...it])
.map(it => it.codePointAt(0).toString(16))
if (codePoints.length === 0) {
const codePoint = config.codePoints[icon]
if (config.codePoints?.[icon]) {
glyphs.push(config.codePoints[icon])
} else {
console.log()
console.error(`${icon} code point could not be determined. Add it to config.codePoints.`)
process.exit(-1)
}
const codePoint = config.codePoints[icon]
if (codePoint) {
glyphs.push(codePoint)
} else if (codePoints.length === 0) {
console.log()
console.error(`${icon} code point could not be determined. Add it to config.codePoints.`)
process.exit(-1)
}
glyphs.push(...codePoints)