12 open my $keysymh, '<', 'data/keysymdef.json' or die $!;
14 return JSON->new->decode(readline $keysymh);
15 } or die "Could not read keysym definitions: $@\n";
57 LSGT => ["§", "±"], # mac
73 my ($pos, $def) = m/^\h* key \h+ <(\w+)> \h+ \{ (.+?) \};/ or next;
74 my @mode = map { [split /,\h*/] } $def =~ m/\[ \h* (.*?) \h* \]/g;
75 for my $shift (0, 1) {
76 defined(my $chr = $mode[0]->[$shift + 2])
77 or warn "missing $pos +$shift\n";
78 if ($chr =~ m/^U ([A-F0-9]+) $/) {
81 elsif (defined $symname->{$chr}) {
82 $chr = $symname->{$chr};
85 warn "unknown symbol $chr at $pos\n";
87 $res{$geochar{$pos}->[$shift] // $pos} = $chr;
88 #$res{$pos}[$shift] = $symname->{$chr} // $chr; # geochar
97 mkkeyboard-xkb-symbols - Character map of an xkb symbols file
101 cat /usr/share/X11/xkb/symbols/us |
102 perl -ne 'print if /^xkb_symbols "intl"/../^\};/' |
103 mkkeyboard-xkb-symbols >map-us-intl.inc.pl
107 Parses C<key> declarations inside an C<xkb_symbols> section
108 and returns a perl hash of normalised qwerty input to unicode output
109 of 3rd and 4th levels (altgr and shift+altgr modes)
110 to be manually cleaned and integrated in a keyboard page include.
114 Mischa POSLAWSKY <perl@shiar.org>
118 Licensed under the GNU Affero General Public License version 3.