From e54f4c238ec8ccca50f2215878b24b3281756953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Thu, 20 Mar 2014 21:44:28 +0100 Subject: [PATCH] Abort keyboard & url selection modes with Ctrl-c; fixes issue #46 --- keyboard-select | 4 +++- url-select | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboard-select b/keyboard-select index 4a8c165..d9f16bf 100644 --- a/keyboard-select +++ b/keyboard-select @@ -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); diff --git a/url-select b/url-select index 941e3c9..6b7fe8c 100644 --- a/url-select +++ b/url-select @@ -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]);