summaryrefslogtreecommitdiffstats
path: root/src/perl
diff options
context:
space:
mode:
authorsf-exg <sf-exg>2014-10-13 17:05:32 +0000
committersf-exg <sf-exg>2014-10-13 17:05:32 +0000
commit25d00d87340484dd85215accd2989b5895a6c51b (patch)
tree2db311b592ce78a0112110fd7530d0dde4002239 /src/perl
parente8909746941fd5bdd468cfacb9d3ac3140b5b874 (diff)
Restore keysym-list extension.
Diffstat (limited to 'src/perl')
-rw-r--r--src/perl/keysym-list37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/perl/keysym-list b/src/perl/keysym-list
new file mode 100644
index 0000000..433fbc5
--- /dev/null
+++ b/src/perl/keysym-list
@@ -0,0 +1,37 @@
+#! perl
+
+=head1 NAME
+
+keysym-list - implement the "list" keysym expansion.
+
+=head1 SYNOPSIS
+
+ urxvt -pe keysym-list
+
+=head1 DESCRIPTION
+
+The "list" keysym expansion was formerly part of the rxvt-unicode core,
+and has been moved into this extension for backwards compatibility. You
+shouldn't use this extension except for compatibility with old
+configurations.
+
+=cut
+
+
+sub on_register_command {
+ my ($self, $keysym, $state, $str) = @_;
+
+ if ($str =~ /^list(.)/) {
+ my @list = split /\Q$1/, $str;
+ if (@list == 3 or @list == 4) {
+ $self->register_command ($keysym++, $state, "string:$list[1]$_$list[3]")
+ for split //, $list[2];
+
+ return 1;
+ }
+
+ warn "unable to parse keysym '$str' as list, processing as normal keysym\n";
+ }
+
+ ()
+}