@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix "\" keyboard shortcut on German keyboard layouts

Summary: Ref T10252. This is similar to D16259, but makes KeyboardShortcutManager more relaxed about `altKey` when typing obscure characters.

Test Plan: Pressed Option + Shift + 7 on a German keyboard layout, saw Conphernece sidebar toggle.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10252

Differential Revision: https://secure.phabricator.com/D16260

+33 -11
+10 -10
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '2fbe65a2', 11 - 'core.pkg.js' => 'f2139810', 11 + 'core.pkg.js' => '49f8bdc0', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '3e81ae60', 14 14 'differential.pkg.js' => '634399e9', ··· 463 463 'rsrc/js/core/FileUpload.js' => '680ea2c8', 464 464 'rsrc/js/core/Hovercard.js' => '1bd28176', 465 465 'rsrc/js/core/KeyboardShortcut.js' => '1ae869f2', 466 - 'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f', 466 + 'rsrc/js/core/KeyboardShortcutManager.js' => '4a021c10', 467 467 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', 468 468 'rsrc/js/core/Notification.js' => 'ccf1cbf8', 469 469 'rsrc/js/core/Prefab.js' => 'cfd23f37', ··· 780 780 'phabricator-filetree-view-css' => 'fccf9f82', 781 781 'phabricator-flag-css' => '5337623f', 782 782 'phabricator-keyboard-shortcut' => '1ae869f2', 783 - 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', 783 + 'phabricator-keyboard-shortcut-manager' => '4a021c10', 784 784 'phabricator-main-menu-view' => 'b623169f', 785 785 'phabricator-nav-view-css' => 'ac79a758', 786 786 'phabricator-notification' => 'ccf1cbf8', ··· 1222 1222 'javelin-dom', 1223 1223 'javelin-stratcom', 1224 1224 ), 1225 + '4a021c10' => array( 1226 + 'javelin-install', 1227 + 'javelin-util', 1228 + 'javelin-stratcom', 1229 + 'javelin-dom', 1230 + 'javelin-vector', 1231 + ), 1225 1232 '4b700e9e' => array( 1226 1233 'javelin-behavior', 1227 1234 'javelin-dom', ··· 1881 1888 'bff6884b' => array( 1882 1889 'javelin-install', 1883 1890 'javelin-dom', 1884 - ), 1885 - 'c1700f6f' => array( 1886 - 'javelin-install', 1887 - 'javelin-util', 1888 - 'javelin-stratcom', 1889 - 'javelin-dom', 1890 - 'javelin-vector', 1891 1891 ), 1892 1892 'c587b80f' => array( 1893 1893 'javelin-install',
+23 -1
webroot/rsrc/js/core/KeyboardShortcutManager.js
··· 32 32 down: 1 33 33 }, 34 34 35 + /** 36 + * Some keys require Alt to be pressed in order to type them on certain 37 + * keyboard layouts. 38 + */ 39 + _altkeys: { 40 + // "Alt+L" on German layouts. 41 + '@': 1, 42 + 43 + // "Alt+Shift+7" on German layouts. 44 + '\\': 1 45 + }, 46 + 35 47 getInstance : function() { 36 48 if (!JX.KeyboardShortcutManager._instance) { 37 49 JX.KeyboardShortcutManager._instance = new JX.KeyboardShortcutManager(); ··· 119 131 } 120 132 }, 121 133 _onkeyhit : function(e) { 134 + var self = JX.KeyboardShortcutManager; 135 + 122 136 var raw = e.getRawEvent(); 123 137 124 - if (raw.altKey || raw.ctrlKey || raw.metaKey) { 138 + if (raw.ctrlKey || raw.metaKey) { 125 139 // Never activate keyboard shortcuts if modifier keys are also 126 140 // depressed. 141 + return; 142 + } 143 + 144 + // For most keystrokes, don't activate keyboard shortcuts if the Alt 145 + // key is depressed. However, we continue if the character requires the 146 + // use of Alt to type it on some keyboard layouts. 147 + var key = this._getKey(e); 148 + if (raw.altKey && !(key in self._altkeys)) { 127 149 return; 128 150 } 129 151