set focus and send on control+enter
This commit is contained in:
parent
ab947c2fce
commit
52efdacbe5
1 changed files with 7 additions and 0 deletions
|
@ -72,8 +72,15 @@ class ComposeWindow(Handy.Window):
|
|||
self.add(box)
|
||||
|
||||
self.show_all()
|
||||
textarea.grab_focus()
|
||||
|
||||
self.connect('key-release-event', self.on_key_release)
|
||||
self.connect('key-press-event', self.on_key_press)
|
||||
|
||||
def on_key_press(self, widget, ev, data=None):
|
||||
ctrl = (ev.state & Gdk.ModifierType.CONTROL_MASK)
|
||||
if ctrl and ev.keyval == Gdk.KEY_Return:
|
||||
self.send_post(None)
|
||||
|
||||
def on_key_release(self, widget, ev, data=None):
|
||||
if ev.keyval == Gdk.KEY_Escape:
|
||||
|
|
Loading…
Reference in a new issue