From 33078a868c971ad767c37c8e5f744a59321e6481 Mon Sep 17 00:00:00 2001 From: Maxim Voloshin Date: Wed, 28 Sep 2016 13:03:47 +0300 Subject: [PATCH 1/2] Spacebar is used to activate Push-To-Talk --- modules/keyboardshortcut/keyboardshortcut.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/keyboardshortcut/keyboardshortcut.js b/modules/keyboardshortcut/keyboardshortcut.js index 9acd2d504..310a82efa 100644 --- a/modules/keyboardshortcut/keyboardshortcut.js +++ b/modules/keyboardshortcut/keyboardshortcut.js @@ -17,7 +17,7 @@ function initGlobalShortcuts() { APP.UI.toggleKeyboardShortcutsPanel(); }, "keyboardShortcuts.toggleShortcuts"); - KeyboardShortcut.registerShortcut("T", null, function() { + KeyboardShortcut.registerShortcut("SPACE", null, function() { JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked"); APP.conference.muteAudio(true); }, "keyboardShortcuts.pushToTalk"); @@ -68,7 +68,7 @@ var KeyboardShortcut = { $(":focus").is("input[type=password]") || $(":focus").is("textarea"))) { var key = self._getKeyboardKey(e).toUpperCase(); - if(key === "T") { + if(key === "SPACE") { if(APP.conference.isLocalAudioMuted()) APP.conference.muteAudio(false); } @@ -139,6 +139,9 @@ var KeyboardShortcut = { * @returns {string} e.key or something close if not supported */ _getKeyboardKey: function (e) { + if (e.which === 32) { + return 'SPACE'; + } if (typeof e.key === "string") { return e.key; } From 6e90b767ef2978fd199346351d41f6cb4ffea51d Mon Sep 17 00:00:00 2001 From: Maxim Voloshin Date: Thu, 29 Sep 2016 16:07:21 +0300 Subject: [PATCH 2/2] Removed separate check for SPACE --- modules/keyboardshortcut/keyboardshortcut.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/keyboardshortcut/keyboardshortcut.js b/modules/keyboardshortcut/keyboardshortcut.js index 310a82efa..799748584 100644 --- a/modules/keyboardshortcut/keyboardshortcut.js +++ b/modules/keyboardshortcut/keyboardshortcut.js @@ -17,10 +17,12 @@ function initGlobalShortcuts() { APP.UI.toggleKeyboardShortcutsPanel(); }, "keyboardShortcuts.toggleShortcuts"); - KeyboardShortcut.registerShortcut("SPACE", null, function() { + // register SPACE shortcut in two steps to insure visibility of help message + KeyboardShortcut.registerShortcut(" ", null, function() { JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked"); APP.conference.muteAudio(true); - }, "keyboardShortcuts.pushToTalk"); + }); + KeyboardShortcut._addShortcutToHelp("SPACE","keyboardShortcuts.pushToTalk"); /** * FIXME: Currently focus keys are directly implemented below in onkeyup. @@ -68,7 +70,7 @@ var KeyboardShortcut = { $(":focus").is("input[type=password]") || $(":focus").is("textarea"))) { var key = self._getKeyboardKey(e).toUpperCase(); - if(key === "SPACE") { + if(key === " ") { if(APP.conference.isLocalAudioMuted()) APP.conference.muteAudio(false); } @@ -139,9 +141,6 @@ var KeyboardShortcut = { * @returns {string} e.key or something close if not supported */ _getKeyboardKey: function (e) { - if (e.which === 32) { - return 'SPACE'; - } if (typeof e.key === "string") { return e.key; }