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)]
|
[alt (if neg? #f 'd/c)]
|
||||||
[meta (if neg? #f 'd/c)]
|
[meta (if neg? #f 'd/c)]
|
||||||
[command (if neg? #f 'd/c)]
|
[command (if neg? #f 'd/c)]
|
||||||
|
[lock 'd/c]
|
||||||
|
[question-mark 'd/c]
|
||||||
|
|
||||||
[do-key
|
[do-key
|
||||||
(λ (char val)
|
(λ (char val)
|
||||||
|
@ -276,18 +278,22 @@
|
||||||
[(#\c) (set! control val)]
|
[(#\c) (set! control val)]
|
||||||
[(#\a) (set! alt val)]
|
[(#\a) (set! alt val)]
|
||||||
[(#\d) (set! command val)]
|
[(#\d) (set! command val)]
|
||||||
[(#\m) (set! meta val)])))
|
[(#\m) (set! meta val)]
|
||||||
|
[(#\l) (set! lock val)]
|
||||||
|
[(#\?) (set! question-mark val)])))
|
||||||
mods)
|
mods)
|
||||||
|
|
||||||
(join-strings ":"
|
(join-strings ":"
|
||||||
(filter
|
(filter
|
||||||
values
|
values
|
||||||
(list
|
(list
|
||||||
|
(do-key #\? question-mark)
|
||||||
(do-key #\a alt)
|
(do-key #\a alt)
|
||||||
(do-key #\c control)
|
(do-key #\c control)
|
||||||
(do-key #\d command)
|
(do-key #\d command)
|
||||||
(do-key #\m meta)
|
(do-key #\m meta)
|
||||||
(do-key #\s shift)
|
(do-key #\s shift)
|
||||||
|
(do-key #\l lock)
|
||||||
canon-key)))))
|
canon-key)))))
|
||||||
|
|
||||||
;; split-out : char (listof char) -> (listof (listof char))
|
;; split-out : char (listof char) -> (listof (listof char))
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
(string=? x str2))
|
(string=? x str2))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(queue-sexp-to-mred
|
(queue-sexp-to-mred
|
||||||
`(keymap:canonicalize-keybinding-string ,str2)))))
|
`(keymap:canonicalize-keybinding-string ,str1)))))
|
||||||
|
|
||||||
(test-canonicalize 1 "c:a" "c:a")
|
(test-canonicalize 1 "c:a" "c:a")
|
||||||
(test-canonicalize 2 "d:a" "d:a")
|
(test-canonicalize 2 "d:a" "d:a")
|
||||||
|
@ -95,6 +95,10 @@
|
||||||
(test-canonicalize 11 "esc;s:a" "esc;s:a")
|
(test-canonicalize 11 "esc;s:a" "esc;s:a")
|
||||||
(test-canonicalize 12 "s:a;esc" "s:a;esc")
|
(test-canonicalize 12 "s:a;esc" "s:a;esc")
|
||||||
(test-canonicalize 13 "ESC;p" "esc;p")
|
(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 ?))
|
;; a key-spec is (make-key-spec buff-spec buff-spec (listof ?) (listof ?) (listof ?))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user