macLinuxKeyboardMapper.ts ×11

Frontier kind: Code frontier

unlabeled · c_bb3bf8afe7e5

82 tests · 9306 LOC · 41 files · introduces 0 tests · 36 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges36 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1279 ranges9306 lines · 41 files · Browse complete extent
All tests (intent)
82 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 36 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts 36 introduced LOC · 11 ranges

Open complete file

234 // Only check that we don't insert the same entry twice
235 if (existingKeyCodeCombos) {
236 > for (let i = 0, len = existingKeyCodeCombos.length; i < len; i++) { macLinuxKeyboardMapper.ts
237 > if (existingKeyCodeCombos[i] === keyCodeComboEncoded) {
238 > // avoid duplicates
239 > return;
240 > }
241 > }
242 }
243 } else {
440 }
441 if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== KeyCode.DependsOnKbLayout) {
442 > continue; macLinuxKeyboardMapper.ts
443 > }
444
445 const rawMapping = rawMappings[strScanCode];
502 }
503 if (IMMUTABLE_CODE_TO_KEY_CODE[scanCode] !== KeyCode.DependsOnKbLayout) {
504 > continue; macLinuxKeyboardMapper.ts
505 > }
506
507 this._codeInfo[scanCode] = rawMappings[strScanCode];
525
526 if (value >= CharCode.a && value <= CharCode.z) {
527 > const upperCaseValue = CharCode.A + (value - CharCode.a); macLinuxKeyboardMapper.ts
528 > this._scanCodeToLabel[scanCode] = String.fromCharCode(upperCaseValue);
529 } else if (value >= CharCode.A && value <= CharCode.Z) {
530 this._scanCodeToLabel[scanCode] = String.fromCharCode(value);
532 this._scanCodeToLabel[scanCode] = String.fromCharCode(value);
533 } else {
534 > this._scanCodeToLabel[scanCode] = null; macLinuxKeyboardMapper.ts
535 > }
536 }
537 }
546 continue;
547 }
548 > const kb = MacLinuxKeyboardMapper._charCodeToKb(withShiftAltGr); macLinuxKeyboardMapper.ts
549 > if (!kb) {
550 continue;
551 }
567 const withAltGr = mapping.withAltGr;
568 if (withAltGr === mapping.withShift || withAltGr === mapping.value) {
569 > // handled below macLinuxKeyboardMapper.ts
570 > continue;
571 > }
572 const kb = MacLinuxKeyboardMapper._charCodeToKb(withAltGr);
573 if (!kb) {
591 const withShift = mapping.withShift;
592 if (withShift === mapping.value) {
593 > // handled below macLinuxKeyboardMapper.ts
594 > continue;
595 > }
596 const kb = MacLinuxKeyboardMapper._charCodeToKb(withShift);
597 if (!kb) {
598 continue;
599 }
600 > const kbShiftKey = kb.shiftKey; macLinuxKeyboardMapper.ts
601 > const keyCode = kb.keyCode;
602 >
603 > if (kbShiftKey) {
604 > // Shift+ScanCode => Shift+KeyCode
605 > _registerIfUnknown(0, 1, 0, scanCode, 0, 1, 0, keyCode); // Shift+ScanCode => Shift+KeyCode
606 > _registerIfUnknown(0, 1, 1, scanCode, 0, 1, 1, keyCode); // Shift+Alt+ScanCode => Shift+Alt+KeyCode
607 > _registerIfUnknown(1, 1, 0, scanCode, 1, 1, 0, keyCode); // Ctrl+Shift+ScanCode => Ctrl+Shift+KeyCode
608 > _registerIfUnknown(1, 1, 1, scanCode, 1, 1, 1, keyCode); // Ctrl+Shift+Alt+ScanCode => Ctrl+Shift+Alt+KeyCode
609 > } else {
610 // Shift+ScanCode => KeyCode
611 _registerIfUnknown(0, 1, 0, scanCode, 0, 0, 0, keyCode); // Shift+ScanCode => KeyCode
625 const kb = MacLinuxKeyboardMapper._charCodeToKb(mapping.value);
626 if (!kb) {
627 > continue; macLinuxKeyboardMapper.ts
628 > }
629 const kbShiftKey = kb.shiftKey;
630 const keyCode = kb.keyCode;
1042 public static getCharCode(char: string): number {
1043 if (char.length === 0) {
1044 > return 0; macLinuxKeyboardMapper.ts
1045 > }
1046 const charCode = char.charCodeAt(0);
1047 switch (charCode) {