From ce03d79120dd28622ab6e8a9051a0d0f46f67e65 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 8 Aug 2005 10:20:24 +0000 Subject: [PATCH] only if shift key is there check after one sec --- src/tabbed_chat_window.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index fbdd143cb..a6fbc9acc 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -398,7 +398,7 @@ class TabbedChatWindow(chat.Chat): # assume no activity and let the motion-notify or key_press make them True # refresh 30 seconds vars too or else it's 30 - 5 = 25 seconds! - self.reset_kbd_mouse_timeout_vars() + self.reset_kbd_mouse_timeout_vars() return True # loop forever def check_for_possible_inactive_chatstate(self, contact): @@ -487,12 +487,18 @@ class TabbedChatWindow(chat.Chat): # in an workaround way (we could also get somehow the listed shortcuts # but I don't know if it's possible) - # get images too (eg. emoticons) - message = message_buffer.get_slice(start_iter, end_iter, True) - message = message.strip() # enter and space does not mean writing - chars_no = len(message) - gobject.timeout_add(1000, self.check_for_possible_composing, - message_buffer, jid, chars_no) + if event.state & gtk.gdk.SHIFT_MASK: + # get images too (eg. emoticons) + message = message_buffer.get_slice(start_iter, end_iter, True) + message = message.strip() # enter and space does not mean writing + chars_no = len(message) + gobject.timeout_add(1000, self.check_for_possible_composing, + message_buffer, jid, chars_no) + else: + self.kbd_activity_in_last_5_secs = True + self.kbd_activity_in_last_30_secs = True + self.send_chatstate('composing', jid) + def check_for_possible_composing(self, message_buffer, jid, chars_no): start_iter, end_iter = message_buffer.get_bounds()