src/vs/platform/keybinding/common/abstractKeybindingService.ts/AbstractKeybindingService/_doDispatch
class AbstractKeybindingService:	private _doDispatch(keybinding: ResolvedKeybinding, target: IContextKeyServiceTarget, isSingleModiferChord = false): boolean {
		let shouldPreventDefault = false;

		if (keybinding.isChord()) {
			console.warn('Unexpected keyboard event mapped to a chord');
			return false;
		}

		let firstPart: string | null = null; // the first keybinding i.e. Ctrl+K
		let currentChord: string | null = null;// the "second" keybinding i.e. Ctrl+K "Ctrl+D"

		if (isSingleModiferChord) {
			const [dispatchKeyname,] = keybinding.getSingleModifierDispatchParts();
			firstPart = dispatchKeyname;
			currentChord = dispatchKeyname;
		} else {
			[firstPart,] = keybinding.getDispatchParts();
			currentChord = this._currentChord ? this._currentChord.keypress : null;
		}

		if (firstPart === null) {
			this._log(`\\ Keyboard event cannot be dispatched in keydown phase.`);
			// cannot be dispatched, probably only modifier keys
			return shouldPreventDefault;
		}

		const contextValue = this._contextKeyService.getContext(target);
		const keypressLabel = keybinding.getLabel();
		const resolveResult = this._getResolver().resolve(contextValue, currentChord, firstPart);

		this._logService.trace('KeybindingService#dispatch', keypressLabel, resolveResult?.commandId);

		if (resolveResult && resolveResult.enterChord) {
			shouldPreventDefault = true;
			this._enterChordMode(firstPart, keypressLabel);
			this._log(`+ Entering chord mode...`);
			return shouldPreventDefault;
		}

		if (this._currentChord) {
			if (!resolveResult || !resolveResult.commandId) {
				this._log(`+ Leaving chord mode: Nothing bound to "${this._currentChord.label} ${keypressLabel}".`);
				this._notificationService.status(nls.localize('missing.chord', "The key combination ({0}, {1}) is not a command.", this._currentChord.label, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
				shouldPreventDefault = true;
			}
		}

		this._leaveChordMode();

		if (resolveResult && resolveResult.commandId) {
			if (!resolveResult.bubble) {
				shouldPreventDefault = true;
			}
			this._log(`+ Invoking command ${resolveResult.commandId}.`);
			if (typeof resolveResult.commandArgs === 'undefined') {
				this._commandService.executeCommand(resolveResult.commandId).then(undefined, err => this._notificationService.warn(err));
			} else {
				this._commandService.executeCommand(resolveResult.commandId, resolveResult.commandArgs).then(undefined, err => this._notificationService.warn(err));
			}
			if (!HIGH_FREQ_COMMANDS.test(resolveResult.commandId)) {
				this._telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: resolveResult.commandId, from: 'keybinding' });
			}
		}

		return shouldPreventDefault;
	}