From 299e241f0d9be983bd166e8b2fcdd8e9e7955143 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 22 Apr 2022 17:16:55 +0200 Subject: [PATCH] Exclude the macOS emoji keyboard from keypresses See https://www.woltlab.com/community/thread/295207-hotkey-f%C3%BCr-emoji-men%C3%BC-funktioniert-im-editor-nicht/ --- .../files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js index 6d1ecb9cfd..41bb6d9c2b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabKeydown.js @@ -15,6 +15,12 @@ $.Redactor.prototype.WoltLabKeydown = function() { var mpInit = this.keydown.init; this.keydown.init = (function (e) { var node; + + // `Ctrl + Cmd + Space` triggers macOS‘s emoji keyboard + if (e.metaKey && e.ctrlKey && e.key === " ") { + e.stopImmediatePropagation(); + return; + } // remove empty whitespaces in front of an when backspacing in Firefox if (this.detect.isFirefox() && selection.isCollapsed && e.which === this.keyCode.BACKSPACE) { -- 2.20.1