aboutsummaryrefslogtreecommitdiff
path: root/emojitrans2.pl
diff options
context:
space:
mode:
Diffstat (limited to 'emojitrans2.pl')
-rwxr-xr-xemojitrans2.pl22
1 files changed, 21 insertions, 1 deletions
diff --git a/emojitrans2.pl b/emojitrans2.pl
index e3eec7c..4f70288 100755
--- a/emojitrans2.pl
+++ b/emojitrans2.pl
@@ -38,8 +38,28 @@ BEGIN { binmode(STDOUT, ":utf8");
'*' => '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 $_;
@@ -61,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>/;