1 | #! perl |
1 | #! perl |
2 | |
2 | |
|
|
3 | =head1 NAME |
|
|
4 | |
|
|
5 | keysym-list - implement the "list" keysym expansion. |
|
|
6 | |
|
|
7 | =head1 SYNOPSIS |
|
|
8 | |
|
|
9 | urxvt -pe keysym-list |
|
|
10 | |
|
|
11 | =head1 DESCRIPTION |
|
|
12 | |
|
|
13 | The "list" keysym expansion was formerly part od the rxvt-unicode core, |
|
|
14 | and has been moved into this extension for backwards compatibility. You |
|
|
15 | shouldn't use this extension except for compatibility with old |
|
|
16 | configurations. |
|
|
17 | |
|
|
18 | =cut |
|
|
19 | |
|
|
20 | |
3 | sub on_register_command { |
21 | sub on_register_command { |
4 | my ($self, $keysym, $state, $str) = @_; |
22 | my ($self, $keysym, $state, $str) = @_; |
5 | |
23 | |
6 | if ($str =~ /^list(.)/) { |
24 | if ($str =~ /^list(.)/) { |
7 | my @list = split /\Q$1/, $str; |
25 | my @list = split /\Q$1/, $str; |
8 | if (@list == 4) { |
26 | if (@list == 3 or @list == 4) { |
9 | for (0 .. (length $list[2]) - 1) { |
27 | $self->register_command ($keysym++, $state, "$list[1]$_$list[3]") |
10 | my $middle = substr $list[2], $_, 1; |
28 | for split //, $list[2]; |
11 | my $def = $list[1] . $middle . $list[3]; |
|
|
12 | $self->register_command ($keysym + $_, $state, $def); |
|
|
13 | } |
|
|
14 | return 1; |
|
|
15 | } |
|
|
16 | |
29 | |
17 | warn "unable to parse keysym '$str' as list, processing as normal keysym\n"; |
30 | return 1; |
18 | } |
31 | } |
19 | |
32 | |
|
|
33 | warn "unable to parse keysym '$str' as list, processing as normal keysym\n"; |
|
|
34 | } |
|
|
35 | |
20 | () |
36 | () |
21 | } |
37 | } |