CTRL+Tab and CTRL+SHIFT+Tab, closes #1396

This commit is contained in:
Travis Shirk 2006-01-14 20:40:48 +00:00
parent 972d3f1f21
commit a10e4b8562
2 changed files with 19 additions and 6 deletions

View File

@ -170,9 +170,15 @@ class ChatControlBase(MessageControl):
self.msg_textview.grab_focus() self.msg_textview.grab_focus()
# Paste into the msg textview # Paste into the msg textview
self.msg_textview.emit('key_press_event', event) self.msg_textview.emit('key_press_event', event)
# CTRL + u: emacs style clear line
elif event.keyval == gtk.keysyms.u: elif event.keyval == gtk.keysyms.u:
# emacs style clear line
self.clear(self.msg_textview) # clear message textview too self.clear(self.msg_textview) # clear message textview too
elif event.keyval == gtk.keysyms.ISO_Left_Tab: # CTRL + SHIFT + TAB
self.parent_win.move_to_next_unread_tab(False)
return True
elif event.keyval == gtk.keysyms.Tab: # CTRL + TAB
self.parent_win.move_to_next_unread_tab(True)
return True
elif event.keyval == gtk.keysyms.m and \ elif event.keyval == gtk.keysyms.m and \
(event.state & gtk.gdk.MOD1_MASK): # alt + m opens emoticons menu (event.state & gtk.gdk.MOD1_MASK): # alt + m opens emoticons menu
if gajim.config.get('useemoticons'): if gajim.config.get('useemoticons'):
@ -212,14 +218,20 @@ class ChatControlBase(MessageControl):
if event.keyval not in (gtk.keysyms.ISO_Left_Tab, gtk.keysyms.Tab): if event.keyval not in (gtk.keysyms.ISO_Left_Tab, gtk.keysyms.Tab):
self.last_key_tabs = False self.last_key_tabs = False
if event.state & gtk.gdk.SHIFT_MASK: if event.state & gtk.gdk.SHIFT_MASK:
# CTRL + SHIFT + TAB
if event.state & gtk.gdk.CONTROL_MASK and \
event.keyval == gtk.keysyms.ISO_Left_Tab:
self.parent_win.move_to_next_unread_tab(False)
return True
# SHIFT + PAGE_[UP|DOWN]: send to conv_textview # SHIFT + PAGE_[UP|DOWN]: send to conv_textview
if event.keyval == gtk.keysyms.Page_Down or \ elif event.keyval == gtk.keysyms.Page_Down or \
event.keyval == gtk.keysyms.Page_Up: event.keyval == gtk.keysyms.Page_Up:
self.conv_textview.emit('key_press_event', event) self.conv_textview.emit('key_press_event', event)
return True return True
elif event.state & gtk.gdk.CONTROL_MASK or \ elif event.state & gtk.gdk.CONTROL_MASK:
(event.keyval == gtk.keysyms.Control_L) or \ if event.keyval == gtk.keysyms.Tab: # CTRL + TAB
(event.keyval == gtk.keysyms.Control_R): self.parent_win.move_to_next_unread_tab(True)
return True
# we pressed a control key or ctrl+sth: we don't block # we pressed a control key or ctrl+sth: we don't block
# the event in order to let ctrl+c (copy text) and # the event in order to let ctrl+c (copy text) and
# others do their default work # others do their default work

View File

@ -442,7 +442,8 @@ class Interface:
show_notification = True show_notification = True
chat_control = gajim.interface.msg_win_mgr.get_control(jid) chat_control = gajim.interface.msg_win_mgr.get_control(jid)
if chat_control and chat_control.type_id == message_control.TYPE_GC: # it's a Private Message if chat_control and chat_control.type_id == message_control.TYPE_GC:
# it's a Private Message
nick = gajim.get_nick_from_fjid(array[0]) nick = gajim.get_nick_from_fjid(array[0])
fjid = array[0] fjid = array[0]
if not gajim.interface.msg_win_mgr.has_window(fjid) and \ if not gajim.interface.msg_win_mgr.has_window(fjid) and \