X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/9830d2491e85baa0f42cb0898f2c19974e21e96a..0eb0af3c6f7b6dda01f5de21de11732ab9cb0cc8:/tools/mkxkeysymdef diff --git a/tools/mkxkeysymdef b/tools/mkxkeysymdef new file mode 100755 index 0000000..e7d7690 --- /dev/null +++ b/tools/mkxkeysymdef @@ -0,0 +1,39 @@ +#!/usr/bin/env perl +use 5.014; +use warnings; +use utf8; +use re '/msx'; +use JSON; + +our $VERSION = '1.00'; + +my %keysym; +while (readline) { + m{ + \A [#]define[ ]XK_ (?[a-zA-Z_0-9]+) + \h+ 0x(?[0-9a-fA-F]+) + \h* [/][*] [\h(] U[+] (?[0-9A-F]{4,6}) + } or next; + $keysym{ $+{name} } = chr hex $+{unicode}; +} + +print JSON->new->ascii->canonical->indent->encode(\%keysym); + +__END__ + +=head1 NAME + +mkxkeysymdef - Map Xorg key symbol names to Unicode characters + +=head1 SYNOPSIS + + mkxkeysymdef /usr/incnlude/X11/keysymdef.h >keysymdef.json + +=head1 AUTHOR + +Mischa POSLAWSKY + +=head1 LICENSE + +Licensed under the GNU Affero General Public License version 3. +