Ver código fonte

Spacebar is used to activate Push-To-Talk

j8
Maxim Voloshin 8 anos atrás
pai
commit
33078a868c
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5
    2
      modules/keyboardshortcut/keyboardshortcut.js

+ 5
- 2
modules/keyboardshortcut/keyboardshortcut.js Ver arquivo

@@ -17,7 +17,7 @@ function initGlobalShortcuts() {
17 17
         APP.UI.toggleKeyboardShortcutsPanel();
18 18
     }, "keyboardShortcuts.toggleShortcuts");
19 19
 
20
-    KeyboardShortcut.registerShortcut("T", null, function() {
20
+    KeyboardShortcut.registerShortcut("SPACE", null, function() {
21 21
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
22 22
         APP.conference.muteAudio(true);
23 23
     }, "keyboardShortcuts.pushToTalk");
@@ -68,7 +68,7 @@ var KeyboardShortcut = {
68 68
                 $(":focus").is("input[type=password]") ||
69 69
                 $(":focus").is("textarea"))) {
70 70
                 var key = self._getKeyboardKey(e).toUpperCase();
71
-                if(key === "T") {
71
+                if(key === "SPACE") {
72 72
                     if(APP.conference.isLocalAudioMuted())
73 73
                         APP.conference.muteAudio(false);
74 74
                 }
@@ -139,6 +139,9 @@ var KeyboardShortcut = {
139 139
      * @returns {string} e.key or something close if not supported
140 140
      */
141 141
     _getKeyboardKey: function (e) {
142
+        if (e.which === 32) {
143
+            return 'SPACE';
144
+        }
142 145
         if (typeof e.key === "string") {
143 146
             return e.key;
144 147
         }

Carregando…
Cancelar
Salvar