@@ -11,7 +11,7 @@ import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
11
11
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode' ;
12
12
import { localize } from 'vs/nls' ;
13
13
import { InstantiationType , registerSingleton } from 'vs/platform/instantiation/common/extensions' ;
14
- import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
14
+ import { IKeybindingService , IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding' ;
15
15
import { AccessibilityHelpAction , AccessibleViewAction , registerAccessibilityConfiguration } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution' ;
16
16
import { AccessibleViewService , AccessibleViewType , IAccessibleContentProvider , IAccessibleViewOptions , IAccessibleViewService } from 'vs/workbench/browser/accessibility/accessibleView' ;
17
17
import * as strings from 'vs/base/common/strings' ;
@@ -27,6 +27,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
27
27
import { getNotificationFromContext } from 'vs/workbench/browser/parts/notifications/notificationsCommands' ;
28
28
import { IListService , WorkbenchList } from 'vs/platform/list/browser/listService' ;
29
29
import { NotificationFocusedContext } from 'vs/workbench/common/contextkeys' ;
30
+ import { KeyCode } from 'vs/base/common/keyCodes' ;
30
31
31
32
registerAccessibilityConfiguration ( ) ;
32
33
registerSingleton ( IAccessibleViewService , AccessibleViewService , InstantiationType . Delayed ) ;
@@ -144,33 +145,46 @@ class NotificationAccessibleViewContribution extends Disposable {
144
145
this . _register ( AccessibleViewAction . addImplementation ( 90 , 'notifications' , accessor => {
145
146
const accessibleViewService = accessor . get ( IAccessibleViewService ) ;
146
147
const listService = accessor . get ( IListService ) ;
147
- const notification = getNotificationFromContext ( listService ) ;
148
- if ( ! notification ) {
149
- return false ;
150
- }
151
- let notificationIndex : number | undefined ;
152
- const list = listService . lastFocusedList ;
153
- if ( list instanceof WorkbenchList ) {
154
- notificationIndex = list . indexOf ( notification ) ;
155
- }
156
- if ( notificationIndex === undefined ) {
157
- return false ;
158
- }
159
- accessibleViewService . show ( {
160
- provideContent : ( ) => { return notification . message . original . toString ( ) || '' ; } ,
161
- onClose ( ) : void {
162
- if ( list && notificationIndex !== undefined ) {
163
- list . domFocus ( ) ;
164
- list . setFocus ( [ notificationIndex ] ) ;
165
- }
166
- } ,
167
- verbositySettingKey : 'notifications' ,
168
- options : {
169
- ariaLabel : localize ( 'notification' , "Notification Accessible View" ) ,
170
- type : AccessibleViewType . View
148
+
149
+ function show ( ) : boolean {
150
+ const notification = getNotificationFromContext ( listService ) ;
151
+ if ( ! notification ) {
152
+ return false ;
171
153
}
172
- } ) ;
173
- return true ;
154
+ let notificationIndex : number | undefined ;
155
+ const list = listService . lastFocusedList ;
156
+ if ( list instanceof WorkbenchList ) {
157
+ notificationIndex = list . indexOf ( notification ) ;
158
+ }
159
+ if ( notificationIndex === undefined ) {
160
+ return false ;
161
+ }
162
+ accessibleViewService . show ( {
163
+ provideContent : ( ) => { return notification . message . original . toString ( ) || '' ; } ,
164
+ onClose ( ) : void {
165
+ if ( list && notificationIndex !== undefined ) {
166
+ list . domFocus ( ) ;
167
+ list . setFocus ( [ notificationIndex ] ) ;
168
+ }
169
+ } ,
170
+ onKeyDown ( e : IKeyboardEvent ) : void {
171
+ if ( e . keyCode === KeyCode . DownArrow && e . altKey && e . ctrlKey ) {
172
+ list ?. focusNext ( ) ;
173
+ show ( ) ;
174
+ } else if ( e . keyCode === KeyCode . UpArrow && e . altKey && e . ctrlKey ) {
175
+ list ?. focusPrevious ( ) ;
176
+ show ( ) ;
177
+ }
178
+ } ,
179
+ verbositySettingKey : 'notifications' ,
180
+ options : {
181
+ ariaLabel : localize ( 'notification' , "Notification Accessible View" ) ,
182
+ type : AccessibleViewType . View
183
+ }
184
+ } ) ;
185
+ return true ;
186
+ }
187
+ return show ( ) ;
174
188
} , NotificationFocusedContext ) ) ;
175
189
}
176
190
}
0 commit comments