diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 90a005a69..05e02c53f 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -32,6 +32,7 @@ import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Gravity;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -2734,10 +2735,10 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
@Override
- public boolean onEnterPressed() {
+ public boolean onEnterPressed(KeyEvent event) {
SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(getActivity());
final boolean enterIsSend = p.getBoolean("enter_is_send", getResources().getBoolean(R.bool.enter_is_send));
- if (enterIsSend) {
+ if (enterIsSend || event.isCtrlPressed()) {
sendMessage();
return true;
} else {
diff --git a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
index 342867576..0687b57b9 100644
--- a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
+++ b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
@@ -57,7 +57,7 @@ public class EditMessage extends EmojiWrapperEditText {
public boolean onKeyDown(int keyCode, KeyEvent e) {
if (keyCode == KeyEvent.KEYCODE_ENTER && !e.isShiftPressed()) {
lastInputWasTab = false;
- if (keyboardListener != null && keyboardListener.onEnterPressed()) {
+ if (keyboardListener != null && keyboardListener.onEnterPressed(e)) {
return true;
}
} else if (keyCode == KeyEvent.KEYCODE_TAB && !e.isAltPressed() && !e.isCtrlPressed()) {
@@ -191,7 +191,7 @@ public class EditMessage extends EmojiWrapperEditText {
}
public interface KeyboardListener {
- boolean onEnterPressed();
+ boolean onEnterPressed(KeyEvent event);
void onTypingStarted();
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 734a015c3..e3b668dfb 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -401,7 +401,7 @@
Mark as read
Input
Enter is send
- Use enter key to send message
+ Use enter key to send message. You can always use ctrl+enter to send message, even if this option is disabled.
Show enter key
Change the emoticons key to an enter key
audio