File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import * as browser from 'vs/base/browser/browser' ;
77import * as platform from 'vs/base/common/platform' ;
88
9+ export const enum KeyboardSupport {
10+ Always ,
11+ FullScreen ,
12+ None
13+ }
14+
915/**
1016 * Browser feature we can support in current platform, browser and environment.
1117 */
@@ -37,9 +43,17 @@ export const BrowserFeatures = {
3743 return true ;
3844 } ) ( )
3945 } ,
40- /*
41- * Full Keyboard Support in Full Screen Mode or Standablone
42- */
43- fullKeyboard : ! ! ( < any > navigator ) . keyboard || browser . isSafari ,
46+ keyboard : ( ( ) => {
47+ if ( platform . isNative || browser . isStandalone ) {
48+ return KeyboardSupport . Always ;
49+ }
50+
51+ if ( ( < any > navigator ) . keyboard || browser . isSafari ) {
52+ return KeyboardSupport . FullScreen ;
53+ }
54+
55+ return KeyboardSupport . None ;
56+ } ) ( ) ,
57+
4458 touch : 'ontouchstart' in window || navigator . maxTouchPoints > 0 || window . navigator . msMaxTouchPoints > 0
4559} ;
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ export class BrowserClipboardService implements IClipboardService {
2727 newTextarea . style . visibility = 'false' ;
2828 newTextarea . style . height = '1px' ;
2929 newTextarea . style . width = '1px' ;
30+ newTextarea . setAttribute ( 'aria-hidden' , 'true' ) ;
31+ newTextarea . style . position = 'absolute' ;
32+ newTextarea . style . top = '-1000' ;
33+ newTextarea . style . left = '-1000' ;
3034 document . body . appendChild ( newTextarea ) ;
3135 newTextarea . value = text ;
3236 newTextarea . focus ( ) ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ import { isArray } from 'vs/base/common/types';
4646import { INavigatorWithKeyboard , IKeyboard } from 'vs/workbench/services/keybinding/browser/navigatorKeyboard' ;
4747import { ScanCodeUtils , IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/common/scanCode' ;
4848import { flatten } from 'vs/base/common/arrays' ;
49- import { BrowserFeatures } from 'vs/base/browser/canIUse' ;
49+ import { BrowserFeatures , KeyboardSupport } from 'vs/base/browser/canIUse' ;
5050
5151interface ContributedKeyBinding {
5252 command : string ;
@@ -241,7 +241,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
241241 this . _register ( browser . onDidChangeFullscreen ( ( ) => {
242242 const keyboard : IKeyboard | null = ( < INavigatorWithKeyboard > navigator ) . keyboard ;
243243
244- if ( ! BrowserFeatures . fullKeyboard ) {
244+ if ( BrowserFeatures . keyboard === KeyboardSupport . None ) {
245245 return ;
246246 }
247247
@@ -352,15 +352,11 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
352352 }
353353
354354 private _assertBrowserConflicts ( kb : Keybinding , commandId : string ) : boolean {
355- if ( ! isWeb ) {
355+ if ( BrowserFeatures . keyboard === KeyboardSupport . Always ) {
356356 return false ;
357357 }
358358
359- if ( browser . isStandalone ) {
360- return false ;
361- }
362-
363- if ( browser . isFullscreen ( ) && BrowserFeatures . fullKeyboard ) {
359+ if ( BrowserFeatures . keyboard === KeyboardSupport . FullScreen && browser . isFullscreen ( ) ) {
364360 return false ;
365361 }
366362
You can’t perform that action at this time.
0 commit comments