From 25d00d87340484dd85215accd2989b5895a6c51b Mon Sep 17 00:00:00 2001 From: sf-exg Date: Mon, 13 Oct 2014 17:05:32 +0000 Subject: Restore keysym-list extension. --- src/perl/keysym-list | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/perl/keysym-list (limited to 'src/perl/keysym-list') 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"; + } + + () +} -- cgit v1.2.3