diff --git a/src/controller/buffers.py b/src/controller/buffers.py index 5998868..4b523ce 100644 --- a/src/controller/buffers.py +++ b/src/controller/buffers.py @@ -672,8 +672,14 @@ class chatBuffer(baseBuffer): def connect_events(self): widgetUtils.connect_event(self.tab.send, widgetUtils.BUTTON_PRESSED, self.send_chat_to_user) widgetUtils.connect_event(self.tab.attachment, widgetUtils.BUTTON_PRESSED, self.add_attachment) + widgetUtils.connect_event(self.tab.text, widgetUtils.KEYPRESS, self.catch_enter) self.tab.set_focus_function(self.onFocus) + def catch_enter(self, event, *args, **kwargs): + if event.GetKeyCode() == wx.WXK_RETURN: + self.send_chat_to_user() + event.Skip() + def get_items(self, show_nextpage=False): if self.can_get_items == False: return retrieved = True # Control variable for handling unauthorised/connection errors. diff --git a/src/wxUI/tabs/home.py b/src/wxUI/tabs/home.py index e717965..196e3ad 100644 --- a/src/wxUI/tabs/home.py +++ b/src/wxUI/tabs/home.py @@ -146,7 +146,6 @@ class chatTab(wx.Panel): self.attachment = wx.Button(self, wx.NewId(), _(u"Add")) sizer.Add(self.attachment, 0, wx.ALL, 5) self.send = wx.Button(self, -1, _(u"Send")) - self.send.SetDefault() sizer.Add(self.send, 0, wx.ALL, 5) self.SetSizer(sizer)