urxvt tabbed extension fragment

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
sub tab_key_press {
my ($self, $tab, $event, $keysym, $str) = @_;
if ($event->{state} & urxvt::ShiftMask) {
if ($keysym == 0xff51 || $keysym == 0xff53) {
my ($idx) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} };
--$idx if $keysym == 0xff51;
++$idx if $keysym == 0xff53;
$self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]);
return 1;
} elsif ($keysym == 0xff54) {
$self->new_tab;
return 1;
}
}
()
}