perf: 按住Ctrl/Command键可连续选择表情

This commit is contained in:
kuaifan 2025-03-08 12:13:25 +08:00
parent ed8e443f3a
commit 617c466ac0
3 changed files with 14 additions and 2 deletions

View File

@ -164,6 +164,13 @@ export default {
immediate: true immediate: true
}, },
isCtrlCommandPressed: {
handler(status) {
this.$store.state.isModKey = status
},
immediate: true
},
windowActive(active) { windowActive(active) {
if (!active) { if (!active) {
this.$store.dispatch("audioStop", true) this.$store.dispatch("audioStop", true)

View File

@ -516,6 +516,8 @@ export default {
'dialogMsgs', 'dialogMsgs',
'cacheKeyboard', 'cacheKeyboard',
'isModKey',
]), ]),
isEnterSend({cacheKeyboard}) { isEnterSend({cacheKeyboard}) {
@ -1419,7 +1421,7 @@ export default {
if (item.type === 'emoji') { if (item.type === 'emoji') {
this.quill.insertText(this.rangeIndex, item.text); this.quill.insertText(this.rangeIndex, item.text);
this.rangeIndex += item.text.length this.rangeIndex += item.text.length
if (this.windowLandscape) { if (this.windowLandscape && !this.isModKey) {
this.showEmoji = false; this.showEmoji = false;
} }
} else if (item.type === 'emoticon') { } else if (item.type === 'emoticon') {
@ -1427,7 +1429,7 @@ export default {
if (item.asset === "emosearch") { if (item.asset === "emosearch") {
this.$emit('input', "") this.$emit('input', "")
} }
if (this.windowLandscape) { if (this.windowLandscape && !this.isModKey) {
this.showEmoji = false; this.showEmoji = false;
} }
} }

View File

@ -39,6 +39,9 @@ export default {
keyboardHeight: 0, // 键盘高度 keyboardHeight: 0, // 键盘高度
safeAreaBottom: 0, // 安全区域底部高度 safeAreaBottom: 0, // 安全区域底部高度
// 是否按下Ctrl/Command键
isModKey: false,
// App通知权限 // App通知权限
appNotificationPermission: true, appNotificationPermission: true,