Abort keyboard & url selection modes with Ctrl-c; fixes issue #46

This commit is contained in:
Bert Münnich 2014-03-20 21:44:28 +01:00
parent 6481d92137
commit e54f4c238e
2 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,9 @@ sub key_press {
my ($self, $event, $keysym, $char) = @_;
my $key = chr($keysym);
if ($self->{search}) {
if (lc($key) eq 'c' && $event->{state} & urxvt::ControlMask) {
deactivate($self);
} elsif ($self->{search}) {
if ($keysym == 0xff1b) {
if ($self->{search_mode}) {
deactivate($self);

View File

@ -122,7 +122,8 @@ sub key_press {
my ($self, $event, $keysym) = @_;
my $char = chr($keysym);
if ($keysym == 0xff1b || lc($char) eq 'q') {
if ($keysym == 0xff1b || lc($char) eq 'q' ||
(lc($char) eq 'c' && $event->{state} & urxvt::ControlMask)) {
deactivate($self);
} elsif ($keysym == 0xff0d || $char eq 'o') {
$self->exec_async(@{$self->{browser}}, ${$self->{found}[$self->{n}]}[4]);