1
2
3
4 dmn
5
6
7
8
9
10
11
12
13
14 ( use-modules ( schematic gui keymap ) )
15 ( use-modules ( schematic keymap ) )
16 ( use-modules ( schematic action ) )
17
18
19
20
21 ( define* ( print-keymap kmap #:optional (indent ) )
22
23
24
25 ( define ( print-indent ind )
26 ( while ( > ind )
27 ( format #t " " )
28 ( set! ind ( ind) )
29 )
30 )
31
32 ( define ( print-key key )
33 ( format #t "~a" (key->display-string key) )
34 )
35
36 NOTE
37
38 ( define ( print-action action )
39 ( let*
40 (
41 ( action-str (format #f "~a" action) )
42 ( action-sym-str (format #f "'~a" action-str) )
43 ( action-sym (eval-string action-sym-str) )
44
45
46 ( action-obj
47 ( if ( defined? action-sym )
48 ( eval-string action-str )
49 #f
50 )
51 )
52 )
53
54 ( format #t "~20t= ~a" action )
55 ( if ( action? action-obj )
56 ( format #t " (~a)" ( action-property action-obj 'label ) )
57 debug
58 )
59 ( format #t "~%" )
60 )
61 )
62
63
64
65
66 ( format #t "~%" )
67
68 ( keymap-for-each
69 ( lambda( key action-or-keymap )
70
71 ( print-indent indent )
72 ( print-key key )
73
74 ( if ( keymap? action-or-keymap )
75 ( print-keymap action-or-keymap ( indent) )
76 ( print-action action-or-keymap )
77 )
78
79 )
80 kmap
81 )
82
83 )
84
85
86
87
88 ( print-keymap %global-keymap )
89