src/vs/platform/keybinding/common/keybinding.ts

123 LOC · 123 covered · 0 uncovered · 1 ranges · 23 concepts · 1 introducers · 14 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filemenuService.test|title=MenuService in group sorting, by title and order|occurrence=1 · 0 introduced LOCmenuService.test|title=M…menuService.ts ×2 · 7 introduced LOCmenuService.ts ×2menuService.ts ×1 · 1 introduced LOCmenuService.ts ×1menuService.ts ×2 · 19 introduced LOCmenuService.ts ×2menuService.ts ×2 · 4 introduced LOCmenuService.ts ×2menuService.ts ×29 · 223 introduced LOCmenuService.ts ×29actions.ts ×4 · 27 introduced LOCactions.ts ×4actions.ts ×7 · 32 introduced LOCactions.ts ×7actions.ts ×2 · 4 introduced LOCactions.ts ×2menuService.ts ×32 · 156 introduced LOCmenuService.ts ×32preferencesModels.ts ×2 · 4 introduced LOCpreferencesModels.ts ×2preferencesModels.test|title=DefaultSettings separates groups with same id but different titles|occurrence=1, preferencesModels.test|title=DefaultSettings groups settings correctly when extension id is same as group id|occurrence=1 · 0 introduced LOCpreferencesModels.test|t…preferencesModels.ts ×2 · 2 introduced LOCpreferencesModels.ts ×2preferencesModels.test|title=DefaultSettings groups settings by title when they share the same extension id|occurrence=1 · 0 introduced LOCpreferencesModels.test|t…preferencesModels.ts ×2 · 6 introduced LOCpreferencesModels.ts ×2preferencesModels.ts ×1 · 1 introduced LOCpreferencesModels.ts ×1preferencesModels.ts ×2 · 7 introduced LOCpreferencesModels.ts ×2preferencesModels.ts ×1 · 2 introduced LOCpreferencesModels.ts ×1preferencesModels.ts ×3 · 3 introduced LOCpreferencesModels.ts ×3preferencesModels.ts ×2 · 3 introduced LOCpreferencesModels.ts ×2preferencesModels.ts ×1 · 3 introduced LOCpreferencesModels.ts ×1preferencesModels.ts ×90 · 441 introduced LOCpreferencesModels.ts ×90keybinding.ts ×1 · 123 introduced LOCkeybinding.ts ×1menuService.test|title=MenuService Extension contributed submenus missing with errors in output #155030|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService Extension contributed submenus missing with errors in output #155030|occurrence=1menuService.test|title=M…menuService.test|title=MenuService group sorting|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService group sorting|occurrence=1menuService.test|title=M…menuService.test|title=MenuService in group sorting, by title and order|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService in group sorting, by title and order|occurrence=1menuService.test|title=M…menuService.test|title=MenuService in group sorting, by title|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService in group sorting, by title|occurrence=1menuService.test|title=M…menuService.test|title=MenuService in group sorting, special: navigation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService in group sorting, special: navigation|occurrence=1menuService.test|title=M…menuService.test|title=MenuService special MenuId palette|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/actions/test/common/menuService.test|title=MenuService special MenuId palette|occurrence=1menuService.test|title=M…preferencesModels.test|title=DefaultSettings groups settings by id when they share the same extension id and have no title|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings groups settings by id when they share the same extension id and have no title|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings groups settings by title when they share the same extension id|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings groups settings by title when they share the same extension id|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings groups settings correctly when extension id is same as group id|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings groups settings correctly when extension id is same as group id|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings merges untitled group into titled group if id matches|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings merges untitled group into titled group if id matches|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings separates groups with same id (no title) but different extension ids|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings separates groups with same id (no title) but different extension ids|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings separates groups with same id and title but different extension ids|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings separates groups with same id and title but different extension ids|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings separates groups with same id but different titles|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings separates groups with same id but different titles|occurrence=1preferencesModels.test|t…preferencesModels.test|title=DefaultSettings sorts groups by order|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/preferences/test/common/preferencesModels.test|title=DefaultSettings sorts groups by order|occurrence=1preferencesModels.test|t…Focused file · src/vs/platform/keybinding/common/keybinding.ts · 123 LOCcommon/keybinding.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- keybinding.ts ×1
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { Event } from '../../../base/common/event.js';
7 > import { IJSONSchema } from '../../../base/common/jsonSchema.js';
8 > import { KeyCode } from '../../../base/common/keyCodes.js';
9 > import { ResolvedKeybinding, Keybinding } from '../../../base/common/keybindings.js';
10 > import { IDisposable } from '../../../base/common/lifecycle.js';
11 > import { IContextKeyService, IContextKeyServiceTarget } from '../../contextkey/common/contextkey.js';
12 > import { createDecorator } from '../../instantiation/common/instantiation.js';
13 > import { ResolutionResult } from './keybindingResolver.js';
14 > import { ResolvedKeybindingItem } from './resolvedKeybindingItem.js';
15 >
16 > export interface IUserFriendlyKeybinding {
17 > key: string;
18 > command: string;
19 > args?: any;
20 > when?: string;
21 > /**
22 > * When `true`, the keybinding is registered as a system-wide (OS global) shortcut that fires
23 > * even when VS Code does not have focus. Desktop only; ignored on web/server. Only honored for
24 > * user `keybindings.json` entries (not extension-contributed keybindings).
25 > */
26 > systemWide?: boolean;
27 > }
28 >
29 > export interface IKeyboardEvent {
30 > readonly _standardKeyboardEventBrand: true;
31 >
32 > readonly ctrlKey: boolean;
33 > readonly shiftKey: boolean;
34 > readonly altKey: boolean;
35 > readonly metaKey: boolean;
36 > readonly altGraphKey: boolean;
37 > readonly keyCode: KeyCode;
38 > readonly code: string;
39 > }
40 >
41 > export interface KeybindingsSchemaContribution {
42 > readonly onDidChange?: Event<void>;
43 >
44 > getSchemaAdditions(): IJSONSchema[];
45 > }
46 >
47 > export const IKeybindingService = createDecorator<IKeybindingService>('keybindingService');
48 >
49 > export interface IKeybindingService {
50 > readonly _serviceBrand: undefined;
51 >
52 > readonly inChordMode: boolean;
53 >
54 > readonly onDidUpdateKeybindings: Event<void>;
55 >
56 > /**
57 > * Returns none, one or many (depending on keyboard layout)!
58 > */
59 > resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[];
60 >
61 > resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;
62 >
63 > resolveUserBinding(userBinding: string): ResolvedKeybinding[];
64 >
65 > /**
66 > * Resolve and dispatch `keyboardEvent` and invoke the command.
67 > */
68 > dispatchEvent(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean;
69 >
70 > /**
71 > * Resolve and dispatch `keyboardEvent`, but do not invoke the command or change inner state.
72 > */
73 > softDispatch(keyboardEvent: IKeyboardEvent, target: IContextKeyServiceTarget): ResolutionResult;
74 >
75 > /**
76 > * Enable hold mode for this command. This is only possible if the command is current being dispatched, meaning
77 > * we are after its keydown and before is keyup event.
78 > *
79 > * @returns A promise that resolves when hold stops, returns undefined if hold mode could not be enabled.
80 > */
81 > enableKeybindingHoldMode(commandId: string): Promise<void> | undefined;
82 >
83 > dispatchByUserSettingsLabel(userSettingsLabel: string, target: IContextKeyServiceTarget): void;
84 >
85 > /**
86 > * Look up keybindings for a command.
87 > * Use `lookupKeybinding` if you are interested in the preferred keybinding.
88 > */
89 > lookupKeybindings(commandId: string): ResolvedKeybinding[];
90 >
91 > /**
92 > * Look up the preferred (last defined) keybinding for a command.
93 > * @returns The preferred keybinding or null if the command is not bound.
94 > */
95 > lookupKeybinding(commandId: string, context?: IContextKeyService, enforceContextCheck?: boolean): ResolvedKeybinding | undefined;
96 >
97 > getDefaultKeybindingsContent(): string;
98 >
99 > getDefaultKeybindings(): readonly ResolvedKeybindingItem[];
100 >
101 > getKeybindings(): readonly ResolvedKeybindingItem[];
102 >
103 > customKeybindingsCount(): number;
104 >
105 > /**
106 > * Will the given key event produce a character that's rendered on screen, e.g. in a
107 > * text box. *Note* that the results of this function can be incorrect.
108 > */
109 > mightProducePrintableCharacter(event: IKeyboardEvent): boolean;
110 >
111 > registerSchemaContribution(contribution: KeybindingsSchemaContribution): IDisposable;
112 >
113 > toggleLogging(): boolean;
114 >
115 > /**
116 > * Given a UI element label and a command ID, appends the keybinding label if any.
117 > * If the command is defined and has a keybinding, returns `${label} (keybinding label)`, otherwise just `label`.
118 > */
119 > appendKeybinding(label: string, commandId: string | undefined | null, context?: IContextKeyService, enforceContextCheck?: boolean): string;
120 >
121 > _dumpDebugInfo(): string;
122 > _dumpDebugInfoJSON(): string;
123 > }