From 9d4e07f0bf75cf4e3a5eefc9e339768f78701e06 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Fri, 27 Mar 2009 12:20:12 +0000 Subject: [PATCH] If people are mad enough to use Ctrl-C for Copy, at least let them still be able to kill things. Closes LP #340604 --- terminatorlib/terminatorterm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index 1626aff8..68eba6e3 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -848,9 +848,16 @@ text/plain return False if mapping and mapping not in self.UnhandledKeybindings: - dbg("on_vte_key_press: lookup found %r" % mapping) - getattr(self, "key_" + mapping)() - return True + dbg("on_vte_key_press: lookup found %r" % mapping) + # handle the case where user has re-bound copy to ctrl+ + # we only copy if there is a selection otherwise let it fall through to ^ + if (mapping == "copy" and event.state & gtk.gdk.CONTROL_MASK): + if self._vte.get_has_selection (): + getattr(self, "key_" + mapping)() + return True + else: + getattr(self, "key_" + mapping)() + return True if self._group and self._vte.is_focus (): self.terminator.group_emit (self, self._group, 'key-press-event', event)