diff options
Diffstat (limited to 'src/perl/keysym-list')
-rw-r--r-- | src/perl/keysym-list | 37 |
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"; + } + + () +} |