TheDiveO
TheDiveO

Reputation: 2701

VSCode in Chrome web browser on Android: how to make {[]} work?

I'm deploying a VSCode server on an RPi 4B/8GB in order to access VSCode from an Android tablet in the browser, without any termux installation. VScode on termux is not an option in my case as I'm developing system-near container workloads that require additional system privileges.

Unfortunately, this doesn't work with respect to AltGr-related keys. After enabling the developer key binding (sic!) output, I was able to catch this output when pressing AltGr+8, which should correspond to [:

developer keybindings logging output

This reveals that Chromium actually sends the [ key, but with AltRight instead of AltGr. (On a sidenote, Firefox on Android actually sends AltGr, but has other quirks that make it totally unsuitable for VSCode in a browser.)

Unfortunately, I couldn't find any VSCode or Electron documentation on how the layout JSON schema works and how to fix such a situation where AltGr isn't even sent.

How can I fix this and make a properly working keyboard layout? Preferably, any fix should not only work in the text editors, but also the terminals.

Upvotes: 0

Views: 1980

Answers (2)

volkbay
volkbay

Reputation: 11

In my case, Shift+AltRight would give AltGr functionality. I am coding with VSCode for Web on Chrome on an Android tablet. On the physical keyboard, the keycap actually reads Alt Gr.

Upvotes: 0

agilejoshua
agilejoshua

Reputation: 2878

I had a similar issue with an Android tablet with physical keyboard in VSCode using Gitpod, my problem was related to VSCode executing keybinding commands for Alt when AltGr was used. Solution for me was to remove all the colliding Alt + command bindings. This is my keybindings.json for reseting numerical keys.

[
    {
        "key": "alt+1",
        "command": "-workbench.action.openEditorAtIndex1"
    },
    {
        "key": "alt+2",
        "command": "-workbench.action.openEditorAtIndex2"
    },
    {
        "key": "alt+3",
        "command": "-workbench.action.openEditorAtIndex3"
    },
    {
        "key": "alt+4",
        "command": "-workbench.action.openEditorAtIndex4"
    },
    {
        "key": "alt+5",
        "command": "-workbench.action.openEditorAtIndex5"
    },
    {
        "key": "alt+6",
        "command": "-workbench.action.openEditorAtIndex6"
    },
    {
        "key": "alt+7",
        "command": "-workbench.action.openEditorAtIndex7"
    },
    {
        "key": "alt+8",
        "command": "-workbench.action.openEditorAtIndex8"
    },
    {
        "key": "alt+9",
        "command": "-workbench.action.openEditorAtIndex9"
    },
    {
        "key": "alt+0",
        "command": "-workbench.action.lastEditorInGroup"
    }
]

Upvotes: 2

Related Questions