Commit 800c5919 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

XML Console: Add keyboard shortcuts

Adds Ctrl+Enter to send and Ctrl+Up to paste the last message
parent 617aad4a
......@@ -120,6 +120,13 @@ def create_tags(self):
def on_key_press_event(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
if (event.get_state() & Gdk.ModifierType.CONTROL_MASK and
event.keyval == Gdk.KEY_Return or
event.keyval == Gdk.KEY_KP_Enter):
if (event.get_state() & Gdk.ModifierType.CONTROL_MASK and
event.keyval == Gdk.KEY_Up):
def on_row_activated(self, listbox, row):
text = row.get_child().get_text()
......@@ -170,7 +177,7 @@ def on_send(self, *args):
self.last_stanza = stanza
def on_paste_last(self, button):
def on_paste_last(self, *args):
buffer_ = self._ui.input_entry.get_buffer()
if buffer_ is not None and self.last_stanza is not None:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment