diff --git a/src/common/config.py b/src/common/config.py index 346e56c8e..cabf709a7 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -35,6 +35,7 @@ class Config: __options = { # name: [ type, value ] + 'send_on_ctrl_enter': [opt_bool, False], # #Send on CTRL-Enter (Enter alone for newline) 'verbose': [ opt_bool, False ], 'delauth': [ opt_bool, True ], 'delroster': [ opt_bool, True ], diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index f3dc05f95..7de867fa0 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -222,8 +222,11 @@ class Tabbed_chat_window(chat.Chat): conversation_textview.emit('key_press_event', event) elif event.keyval == gtk.keysyms.Return or \ event.keyval == gtk.keysyms.KP_Enter: # ENTER - if (event.state & gtk.gdk.SHIFT_MASK): - return False + if gajim.config.get('send_on_ctrl_enter'): + if not (event.state & gtk.gdk.CONTROL_MASK): + return False + elif (event.state & gtk.gdk.SHIFT_MASK): + return False if gajim.connections[self.account].connected < 2: #we are not connected dialogs.Error_dialog(_('You are not connected, so you cannot send a message')) return True