Skip to content

Commit 1b3a0bc

Browse files
committed
get it to work
1 parent 8af0a84 commit 1b3a0bc

File tree

4 files changed

+22
-27
lines changed

4 files changed

+22
-27
lines changed

src/vs/editor/common/standaloneStrings.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ export namespace AccessibilityHelpNLS {
1515
export const changeConfigToOnMac = nls.localize("changeConfigToOnMac", "To configure the editor to be optimized for usage with a Screen Reader press Command+E now.");
1616
export const changeConfigToOnWinLinux = nls.localize("changeConfigToOnWinLinux", "To configure the editor to be optimized for usage with a Screen Reader press Control+E now.");
1717
export const auto_on = nls.localize("auto_on", "The editor is configured to be optimized for usage with a Screen Reader.");
18-
export const auto_off = nls.localize("auto_off", "The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time.");
18+
export const auto_off = nls.localize("auto_off", "The editor is configured to never be optimized for usage with a Screen Reader");
1919
export const tabFocusModeOnMsg = nls.localize("tabFocusModeOnMsg", "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}.");
2020
export const tabFocusModeOnMsgNoKb = nls.localize("tabFocusModeOnMsgNoKb", "Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.");
2121
export const tabFocusModeOffMsg = nls.localize("tabFocusModeOffMsg", "Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}.");
2222
export const tabFocusModeOffMsgNoKb = nls.localize("tabFocusModeOffMsgNoKb", "Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding.");
23-
export const openDocMac = nls.localize("openDocMac", "Press Command+H now to open a browser window with more information related to editor accessibility.");
24-
export const openDocWinLinux = nls.localize("openDocWinLinux", "Press Control+H now to open a browser window with more information related to editor accessibility.");
23+
export const openDoc = nls.localize("openDoc", "Press H now to open a browser window with more information related to editor accessibility.");
2524
export const showAccessibilityHelpAction = nls.localize("showAccessibilityHelpAction", "Show Accessibility Help");
2625
}
2726

src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/b
1212
import { localize } from 'vs/nls';
1313
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
1414
import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions';
15-
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
15+
import { IKeybindingService, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
1616
import { AccessibilityHelpAction, registerAccessibilityConfiguration } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
1717
import { AccessibleViewService, IAccessibleContentProvider, IAccessibleViewOptions, IAccessibleViewService } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
1818
import * as strings from 'vs/base/common/strings';
@@ -23,6 +23,9 @@ import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle
2323
import { Registry } from 'vs/platform/registry/common/platform';
2424
import { ICommandService } from 'vs/platform/commands/common/commands';
2525
import { NEW_UNTITLED_FILE_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileConstants';
26+
import { KeyCode } from 'vs/base/common/keyCodes';
27+
import { URI } from 'vs/base/common/uri';
28+
import { IOpenerService } from 'vs/platform/opener/common/opener';
2629

2730
registerAccessibilityConfiguration();
2831
registerSingleton(IAccessibleViewService, AccessibleViewService, InstantiationType.Delayed);
@@ -34,10 +37,21 @@ class AccessibilityHelpProvider extends Disposable implements IAccessibleContent
3437
}
3538
options: IAccessibleViewOptions = { ariaLabel: localize('terminal-help-label', "terminal accessibility help") };
3639
id: string = 'editor';
40+
onKeyDown(e: IKeyboardEvent): void {
41+
if (e.keyCode === KeyCode.KeyH) {
42+
alert(AccessibilityHelpNLS.openingDocs);
3743

44+
let url = (this._editor.getRawOptions() as any).accessibilityHelpUrl;
45+
if (typeof url === 'undefined') {
46+
url = 'https://go.microsoft.com/fwlink/?linkid=852450';
47+
}
48+
this._openerService.open(URI.parse(url));
49+
}
50+
}
3851
constructor(
3952
private readonly _editor: ICodeEditor,
4053
@IKeybindingService private readonly _keybindingService: IKeybindingService,
54+
@IOpenerService private readonly _openerService: IOpenerService
4155
) {
4256
super();
4357
}
@@ -91,14 +105,7 @@ class AccessibilityHelpProvider extends Disposable implements IAccessibleContent
91105
} else {
92106
content.push(this._descriptionForCommand(ToggleTabFocusModeAction.ID, AccessibilityHelpNLS.tabFocusModeOffMsg, AccessibilityHelpNLS.tabFocusModeOffMsgNoKb));
93107
}
94-
95-
const openDocMessage = (
96-
platform.isMacintosh
97-
? AccessibilityHelpNLS.openDocMac
98-
: AccessibilityHelpNLS.openDocWinLinux
99-
);
100-
101-
content.push(openDocMessage);
108+
content.push(AccessibilityHelpNLS.openDoc);
102109
return content.join('\n');
103110
}
104111
}

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
67
import { KeyCode } from 'vs/base/common/keyCodes';
78
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
89
import { URI } from 'vs/base/common/uri';
@@ -20,7 +21,8 @@ import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEdito
2021
import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
2122
import { IDisposable } from 'xterm';
2223

23-
export interface IAccessibleContentProvider { id: string; provideContent(): string; onClose(): void; options: IAccessibleViewOptions }
24+
25+
export interface IAccessibleContentProvider { id: string; provideContent(): string; onClose(): void; onKeyDown?(e: IKeyboardEvent): void; options: IAccessibleViewOptions }
2426
export const IAccessibleViewService = createDecorator<IAccessibleViewService>('accessibleViewService');
2527

2628
export interface IAccessibleViewService {
@@ -100,6 +102,7 @@ class AccessibleView extends Disposable {
100102
if (e.keyCode === KeyCode.Escape) {
101103
this._contextViewService.hideContextView();
102104
}
105+
provider.onKeyDown?.(e);
103106
}));
104107
this._register(this._editorWidget.onDidBlurEditorText(() => this._contextViewService.hideContextView()));
105108
this._register(this._editorWidget.onDidContentSizeChange(() => this._layout()));

0 commit comments

Comments
 (0)