use
keyval == keysyms.Tab or keyval == keysyms.ISO_Left_Tab instead of: hardware_keycode == 23 so it works under win too.
This commit is contained in:
parent
5555d6e317
commit
c2481dc949
16
src/chat.py
16
src/chat.py
|
@ -294,13 +294,11 @@ class Chat:
|
|||
|
||||
def on_conversation_textview_key_press_event(self, widget, event):
|
||||
"""Do not block these events and send them to the notebook"""
|
||||
if (event.state & gtk.gdk.CONTROL_MASK) and \
|
||||
(event.state & gtk.gdk.SHIFT_MASK):
|
||||
if event.hardware_keycode == 23: # CTRL + SHIFT + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.state & gtk.gdk.CONTROL_MASK:
|
||||
if event.state & gtk.gdk.CONTROL_MASK:
|
||||
if event.keyval == gtk.keysyms.Tab: # CTRL + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.keyval == gtk.keysyms.ISO_Left_Tab: # CTRL + SHIFT + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.keyval == gtk.keysyms.Page_Down: # CTRL + PAGE DOWN
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.keyval == gtk.keysyms.Page_Up: # CTRL + PAGE UP
|
||||
|
@ -353,15 +351,15 @@ class Chat:
|
|||
conversation_scrolledwindow = self.xml.get_widget('conversation_scrolledwindow')
|
||||
conversation_scrolledwindow.emit('scroll-child',
|
||||
gtk.SCROLL_PAGE_BACKWARD, False)
|
||||
elif event.hardware_keycode == 23: # TAB
|
||||
if (event.state & gtk.gdk.CONTROL_MASK) and \
|
||||
(event.state & gtk.gdk.SHIFT_MASK): # CTRL + SHIFT + TAB
|
||||
elif event.keyval == gtk.keysyms.ISO_Left_Tab: # SHIFT + TAB
|
||||
if (event.state & gtk.gdk.CONTROL_MASK): # CTRL + SHIFT + TAB
|
||||
current = self.notebook.get_current_page()
|
||||
if current > 0:
|
||||
self.notebook.set_current_page(current - 1)
|
||||
else:
|
||||
self.notebook.set_current_page(self.notebook.get_n_pages()-1)
|
||||
elif event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
elif event.keyval == gtk.keysyms.Tab: # TAB
|
||||
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
current = self.notebook.get_current_page()
|
||||
if current < (self.notebook.get_n_pages()-1):
|
||||
self.notebook.set_current_page(current + 1)
|
||||
|
|
|
@ -287,11 +287,11 @@ class Groupchat_window(chat.Chat):
|
|||
room_jid = self.get_active_jid()
|
||||
conversation_textview = self.xmls[room_jid].get_widget(
|
||||
'conversation_textview')
|
||||
if event.hardware_keycode == 23: # TAB
|
||||
if (event.state & gtk.gdk.CONTROL_MASK) and \
|
||||
(event.state & gtk.gdk.SHIFT_MASK): # CTRL + SHIFT + TAB
|
||||
if event.keyval == gtk.keysyms.ISO_Left_Tab: # SHIFT + TAB
|
||||
if (event.state & gtk.gdk.CONTROL_MASK): # CTRL + SHIFT + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
elif event.keyval == gtk.keysyms.Tab: # TAB
|
||||
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
else:
|
||||
list_nick = self.get_nick_list(room_jid)
|
||||
|
|
|
@ -190,11 +190,11 @@ class Tabbed_chat_window(chat.Chat):
|
|||
and printed in the conversation"""
|
||||
jid = self.get_active_jid()
|
||||
conversation_textview = self.xmls[jid].get_widget('conversation_textview')
|
||||
if event.hardware_keycode == 23: # TAB (do not make it .Tab ==> fails)
|
||||
if (event.state & gtk.gdk.CONTROL_MASK) and \
|
||||
(event.state & gtk.gdk.SHIFT_MASK): # CTRL + SHIFT + TAB
|
||||
if event.keyval == gtk.keysyms.ISO_Left_Tab: # SHIFT + TAB
|
||||
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + SHIFT + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
if event.keyval == gtk.keysyms.Tab:
|
||||
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + TAB
|
||||
self.notebook.emit('key_press_event', event)
|
||||
elif event.keyval == gtk.keysyms.Page_Down: # PAGE DOWN
|
||||
if event.state & gtk.gdk.CONTROL_MASK: # CTRL + PAGE DOWN
|
||||
|
|
Loading…
Reference in New Issue