microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.23k stars 28.87k forks source link

Web: desktop-reserved keybindings non functional in fullscreen Firefox #83343

Open bpasero opened 4 years ago

bpasero commented 4 years ago

Maybe we cannot get this to work, but: when I use Firefox and go fullscreen, hitting a key such as Cmd+W to close an editor is still closing the entire window. That makes it almost impossible to use VSCode in Firefox.

To make matters worse: simply pressing Esc-key gets out of fullscreen instantly....

bpasero commented 4 years ago

I think we should investigate for November to see what is missing here.

@rebornix where is the code that checks for being able to bind all our commands?

rebornix commented 4 years ago

At this moment we only bring back all keybindings when navigator.keyboard exits.

But based on my current testing, it seems if in Full Screen Mode, we can actually receive most of the keyboard events in Safari, but not Firefox. The code is https://github.com/microsoft/vscode/blob/7ab195a8973c74871c22b2add0f810b716028940/src/vs/workbench/services/keybinding/browser/keybindingService.ts#L245-L249 . I'll play with both browsers and see how to make it work. At least for now, I didn't see a plain simple solution for Firefox.

I'm also wondering whether it's because I upgraded to Catalina as previously, Keybindings in Full Screen in Safari doesn't seem to work. I need to double check.

bpasero commented 4 years ago

At least for now, I didn't see a plain simple solution for Firefox.

Yeah, Firefox seems really hard to get working. No matter what, in fullscreen a simple ESC press exits fullscreen...

I'm also wondering whether it's because I upgraded to Catalina as previously, Keybindings in Full Screen in Safari doesn't seem to work. I need to double check.

If I disable the code in keybindings.ts that requires navigator.keyboard, I can get e.g. Cmd+N to work in Safari when I am in fullscreen mode. I am on macOS 10.14.6. Maybe we should be less strict and not require navigator.keyboard for our logic?

rebornix commented 4 years ago

Maybe we should be less strict and not require navigator.keyboard for our logic?

I think so, I relaxed it a bit in #83957.

Update For Firefox, currently it's not possible to override browser keybindings by any means as a web app, due to https://bugzilla.mozilla.org/show_bug.cgi?id=380637 (100 page long, 13 years old discussion).

The keybinding experience can only be improved when one of following issue is resolved:

djbrown commented 1 week ago

backreference to closed unanswered https://github.com/orgs/community/discussions/40566