diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e69a0cb..61c16738d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Group changes to describe their impact on the project, as follows: - Ask Android to not process what user types in an encrypted chat room to improve privacy, see [IME_FLAG_NO_PERSONALIZED_LEARNING](https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_PERSONALIZED_LEARNING) - New video call UI on foldable device like Galaxy Z Fold - Setting to automatically record all calls +- When using a physical keyboard, use left control + enter keys to send message ### Changed - UI has been reworked around SlidingPane component to better handle tablets & foldable devices diff --git a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt index 0a4cf8819..f48bc63b8 100644 --- a/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt +++ b/app/src/main/java/org/linphone/activities/main/chat/fragments/DetailChatRoomFragment.kt @@ -53,6 +53,7 @@ import org.linphone.activities.main.chat.adapters.ChatMessagesListAdapter import org.linphone.activities.main.chat.data.ChatMessageData import org.linphone.activities.main.chat.data.EventLogData import org.linphone.activities.main.chat.viewmodels.* +import org.linphone.activities.main.chat.views.RichEditTextSendListener import org.linphone.activities.main.fragments.MasterFragment import org.linphone.activities.main.viewmodels.DialogViewModel import org.linphone.activities.main.viewmodels.SharedMainViewModel @@ -511,6 +512,13 @@ class DetailChatRoomFragment : MasterFragment + if (keyCode == KeyEvent.KEYCODE_CTRL_LEFT) { + if (event.action == KeyEvent.ACTION_DOWN) { + controlPressed = true + } else if (event.action == KeyEvent.ACTION_UP) { + controlPressed = false + } + false + } else if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP && controlPressed) { + sendListener?.onControlEnterPressedAndReleased() + true + } else { + false + } + } } } + +interface RichEditTextSendListener { + fun onControlEnterPressedAndReleased() +}