add back button

This commit is contained in:
2023-01-01 22:22:40 +00:00
parent bc17c3af6c
commit c1b7c2d777
5 changed files with 14 additions and 8 deletions
+5 -6
View File
@@ -30,15 +30,15 @@
(fn keychord->spec [keychord]
(let [Mod Gdk.ModifierType
symbol (keychord:match "(%w+)$")
upper? (and (symbol:match "%u") true)
modmask (accumulate [m (if upper? Mod.SHIFT_MASK 0)
; upper? (and (symbol:match "%u") true)
modmask (accumulate [m 0 ;(if upper? Mod.SHIFT_MASK 0)
v (keychord:gmatch "(%w+)-")]
(match (v:lower)
"m" (bor m Mod.MOD1_MASK)
"c" (bor m Mod.CONTROL_MASK)
"s" (bor m Mod.MOD4_MASK)))]
{
:keyval (string.byte (symbol:lower))
:keyval (Gdk.keyval_from_name symbol)
: modmask
}))
@@ -131,9 +131,8 @@
{ : recogniser
:keyval {
:Escape (Gdk.keyval_from_name "Escape")
}
:keyval (collect [_ name (ipairs [:Escape :Delete :BackSpace])]
(values name (Gdk.keyval_from_name name)))
:_ {
;; symbols in _ are exported only for testing
: keychord->spec