diff options
author | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2021-04-21 14:06:38 +0100 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@broadbean.com> | 2021-04-21 14:06:38 +0100 |
commit | e4290719f5e0db60fb0f70d1872dd37c973dbed8 (patch) | |
tree | 2d55ad46548f79cb72bb7d3f389639930134ce6f /emojitrans2.pl | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge branch 'emacsmode' (diff) | |
download | dotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.tar.gz dotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.tar.bz2 dotXCompose-e4290719f5e0db60fb0f70d1872dd37c973dbed8.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'emojitrans2.pl')
-rwxr-xr-x | emojitrans2.pl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/emojitrans2.pl b/emojitrans2.pl index 27ee545..4f70288 100755 --- a/emojitrans2.pl +++ b/emojitrans2.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -p +#!/usr/bin/env -S perl -p use feature 'unicode_strings'; use utf8; BEGIN { binmode(STDOUT, ":utf8"); @@ -36,9 +36,30 @@ BEGIN { binmode(STDOUT, ":utf8"); '=' => 'equal', ' ' => 'space', '*' => 'asterisk', + '&' => 'ampersand', '♫' => 'Multi_key', + '←' => 'Left', + '→' => 'Right', + '↑' => 'Up', + '↓' => 'Down', + '⇐' => 'BackSpace', + '⇤' => 'Home', + '⇥' => 'End', + '⇑' => 'Prior', # PageUp + '⇓' => 'Next', # PageDown + '↵' => 'Return', + '∇' => 'Delete', # Del, get it? + '˅' => 'Insert', # it'll do. + '˃' => 'Control_R', + '˂' => 'Control_L', + # Function-keys? ¹ ²..ˣ ᵉ ᵗ? ); + $specials = join "", keys %specials; + # Because of reasons + $specials =~ s/[]\\-]/\\$&/g; + $RE = qr{([[:alnum:]$specials]+)}; + sub splitup { my $arg=shift; local $_; @@ -60,7 +81,7 @@ unless (/^#/) { my $hold=$_; s/<M_>/<Multi_key>/; s/<MM>/<Multi_key> <Multi_key>/; - s({([][[:alnum:] _+:;%@>=`<,.^\$+#()?!/|'"\\~*{}♫-]+)})(splitup($1))e; + s({($RE)})(splitup($1))e; if (length($1) > 7) { $_=$hold; s/^<M([M_])>/### <M$1>/; |