瀏覽代碼

Removed separate check for SPACE

master
Maxim Voloshin 9 年之前
父節點
當前提交
6e90b767ef
共有 1 個檔案被更改,包括 5 行新增6 行删除
  1. 5
    6
      modules/keyboardshortcut/keyboardshortcut.js

+ 5
- 6
modules/keyboardshortcut/keyboardshortcut.js 查看文件

17
         APP.UI.toggleKeyboardShortcutsPanel();
17
         APP.UI.toggleKeyboardShortcutsPanel();
18
     }, "keyboardShortcuts.toggleShortcuts");
18
     }, "keyboardShortcuts.toggleShortcuts");
19
 
19
 
20
-    KeyboardShortcut.registerShortcut("SPACE", null, function() {
20
+    // register SPACE shortcut in two steps to insure visibility of help message
21
+    KeyboardShortcut.registerShortcut(" ", null, function() {
21
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
22
         JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
22
         APP.conference.muteAudio(true);
23
         APP.conference.muteAudio(true);
23
-    }, "keyboardShortcuts.pushToTalk");
24
+    });
25
+    KeyboardShortcut._addShortcutToHelp("SPACE","keyboardShortcuts.pushToTalk");
24
 
26
 
25
     /**
27
     /**
26
      * FIXME: Currently focus keys are directly implemented below in onkeyup.
28
      * FIXME: Currently focus keys are directly implemented below in onkeyup.
68
                 $(":focus").is("input[type=password]") ||
70
                 $(":focus").is("input[type=password]") ||
69
                 $(":focus").is("textarea"))) {
71
                 $(":focus").is("textarea"))) {
70
                 var key = self._getKeyboardKey(e).toUpperCase();
72
                 var key = self._getKeyboardKey(e).toUpperCase();
71
-                if(key === "SPACE") {
73
+                if(key === " ") {
72
                     if(APP.conference.isLocalAudioMuted())
74
                     if(APP.conference.isLocalAudioMuted())
73
                         APP.conference.muteAudio(false);
75
                         APP.conference.muteAudio(false);
74
                 }
76
                 }
139
      * @returns {string} e.key or something close if not supported
141
      * @returns {string} e.key or something close if not supported
140
      */
142
      */
141
     _getKeyboardKey: function (e) {
143
     _getKeyboardKey: function (e) {
142
-        if (e.which === 32) {
143
-            return 'SPACE';
144
-        }
145
         if (typeof e.key === "string") {
144
         if (typeof e.key === "string") {
146
             return e.key;
145
             return e.key;
147
         }
146
         }

Loading…
取消
儲存