feat: enables inserting emojis and mentions using Tab as well
This commit is contained in:
parent
dc313e200a
commit
94f1267ea9
|
@ -92,18 +92,25 @@ Rectangle {
|
|||
return (event.key === Qt.Key_U) && (event.modifiers & Qt.ControlModifier) && imageBtn.visible && !imageDialog.visible
|
||||
}
|
||||
|
||||
function checkTextInsert() {
|
||||
if (emojiSuggestions.visible) {
|
||||
emojiSuggestions.addEmoji();
|
||||
return true
|
||||
}
|
||||
if (suggestionsBox.visible) {
|
||||
suggestionsBox.selectCurrentItem();
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function onKeyPress(event){
|
||||
if (event.modifiers === Qt.NoModifier && (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) {
|
||||
if (emojiSuggestions.visible) {
|
||||
emojiSuggestions.addEmoji();
|
||||
event.accepted = true;
|
||||
return
|
||||
}
|
||||
if (suggestionsBox.visible) {
|
||||
suggestionsBox.selectCurrentItem();
|
||||
if (checkTextInsert()) {
|
||||
event.accepted = true;
|
||||
return
|
||||
}
|
||||
|
||||
if (control.isStatusUpdateInput) {
|
||||
return // Status update require the send button to be clicked
|
||||
}
|
||||
|
@ -116,6 +123,13 @@ Rectangle {
|
|||
messageTooLongDialog.open()
|
||||
}
|
||||
|
||||
if (event.key === Qt.Key_Tab) {
|
||||
if (checkTextInsert()) {
|
||||
event.accepted = true;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const message = control.extrapolateCursorPosition();
|
||||
|
||||
// handle new line in blockquote
|
||||
|
|
Loading…
Reference in New Issue