fix canonicalize-keybinding-string for ?: and l: modifiers
also fix test suite to actually run the tests
This commit is contained in:
parent
790ae0705c
commit
84f98f6211
|
@ -259,6 +259,8 @@
|
|||
[alt (if neg? #f 'd/c)]
|
||||
[meta (if neg? #f 'd/c)]
|
||||
[command (if neg? #f 'd/c)]
|
||||
[lock 'd/c]
|
||||
[question-mark 'd/c]
|
||||
|
||||
[do-key
|
||||
(λ (char val)
|
||||
|
@ -276,18 +278,22 @@
|
|||
[(#\c) (set! control val)]
|
||||
[(#\a) (set! alt val)]
|
||||
[(#\d) (set! command val)]
|
||||
[(#\m) (set! meta val)])))
|
||||
[(#\m) (set! meta val)]
|
||||
[(#\l) (set! lock val)]
|
||||
[(#\?) (set! question-mark val)])))
|
||||
mods)
|
||||
|
||||
(join-strings ":"
|
||||
(filter
|
||||
values
|
||||
(list
|
||||
(do-key #\? question-mark)
|
||||
(do-key #\a alt)
|
||||
(do-key #\c control)
|
||||
(do-key #\d command)
|
||||
(do-key #\m meta)
|
||||
(do-key #\s shift)
|
||||
(do-key #\l lock)
|
||||
canon-key)))))
|
||||
|
||||
;; split-out : char (listof char) -> (listof (listof char))
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
(string=? x str2))
|
||||
(lambda ()
|
||||
(queue-sexp-to-mred
|
||||
`(keymap:canonicalize-keybinding-string ,str2)))))
|
||||
`(keymap:canonicalize-keybinding-string ,str1)))))
|
||||
|
||||
(test-canonicalize 1 "c:a" "c:a")
|
||||
(test-canonicalize 2 "d:a" "d:a")
|
||||
|
@ -95,6 +95,10 @@
|
|||
(test-canonicalize 11 "esc;s:a" "esc;s:a")
|
||||
(test-canonicalize 12 "s:a;esc" "s:a;esc")
|
||||
(test-canonicalize 13 "ESC;p" "esc;p")
|
||||
(test-canonicalize 14 "?:a:v" "?:a:v")
|
||||
(test-canonicalize 15 "a:?:v" "?:a:v")
|
||||
(test-canonicalize 16 "l:v" "l:v")
|
||||
(test-canonicalize 17 "c:l:v" "c:l:v")
|
||||
|
||||
|
||||
;; a key-spec is (make-key-spec buff-spec buff-spec (listof ?) (listof ?) (listof ?))
|
||||
|
|
Loading…
Reference in New Issue
Block a user