l and v keys are now printed in message textview when conversation tv has focus

This commit is contained in:
Yann Leboulanger 2005-06-30 19:47:08 +00:00
parent 3b592c9ac5
commit 281ab32034
1 changed files with 12 additions and 13 deletions

View File

@ -480,19 +480,18 @@ class Chat:
self.notebook.next_page()
else: # traverse for ever (eg. don't stop at last tab)
self.notebook.set_current_page(0)
elif event.keyval == gtk.keysyms.l or \
event.keyval == gtk.keysyms.L:
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + L
conversation_textview = self.xmls[jid].\
get_widget('conversation_textview')
conversation_textview.get_buffer().set_text('')
elif event.keyval == gtk.keysyms.v:
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + V
jid = self.get_active_jid()
message_textview = self.xmls[jid].get_widget('message_textview')
if not message_textview.is_focus():
message_textview.grab_focus()
message_textview.emit('key_press_event', event)
elif (event.keyval == gtk.keysyms.l or event.keyval == gtk.keysyms.L) \
and event.state & gtk.gdk.CONTROL_MASK: # CTRL + L
conversation_textview = self.xmls[jid].\
get_widget('conversation_textview')
conversation_textview.get_buffer().set_text('')
elif event.keyval == gtk.keysyms.v and event.state & gtk.gdk.CONTROL_MASK:
# CTRL + V
jid = self.get_active_jid()
message_textview = self.xmls[jid].get_widget('message_textview')
if not message_textview.is_focus():
message_textview.grab_focus()
message_textview.emit('key_press_event', event)
elif event.state & gtk.gdk.CONTROL_MASK or \
(event.keyval == gtk.keysyms.Control_L) or \
(event.keyval == gtk.keysyms.Control_R):