coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.81k stars 5.57k forks source link

[Bug]: Keyboard shortcuts can't work on Android browsers #6480

Closed html5syt closed 10 months ago

html5syt commented 11 months ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. open code-server.
  2. return to desktop and open browsers.
  3. open 127.0.0.1:8888
  4. login
  5. open"keyboard shortcuts (Ctrl+k Ctrl+s)"
  6. touch pen on left and try to change keyboard shortcuts.

Expected

I can change it and the input will show it,such as"Ctrl+Alt+h",and I can use it normally in editor.

Actual

When I try to change it,the input show like "Ctrl+unknown" and I can't use it normally.

I tried all of the keyboard on Android that they can input Ctrl and so on. I tried the keyboard on other website that can use keyboard shortcuts and they're work correctly.

Why I don't use physical keyboard?Because I don't have Bluetooth keyboard and I want to use vscode without physical keyboard.

Logs

It's too big,and I will put a file under.(you maybe should change .txt.png to .txt) i txt png

Screenshot/Video

https://github.com/coder/code-server/assets/53525043/25530f85-082f-4ae7-8843-95f3a6497f5d

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over HTTPS?

Notes

PLEASE DON'T care about "I am using HTTPS. "check box.On local address can't have HTTPS!I'm only check it to avoid check.

html5syt commented 11 months ago

I don't have schedule to use code-server in this phone on other machine.

zongou commented 10 months ago

add this to your seeting.json

{
    "keyboard.dispatch": "keyCode"
}
Splizard commented 10 months ago

@zongou I added this to the documentation, maybe this configuration could be enabled by default on mobile browsers? not sure on the feasibility of this, perhaps a core contributor can comment on this.

zongou commented 10 months ago

@zongou I added this to the documentation, maybe this configuration could be enabled by default on mobile browsers? not sure on the feasibility of this, perhaps a core contributor can comment on this.

it is easy to change the default value, i agree that we should change the default value. PR will come soon

code-asher commented 10 months ago

If at all possible, see if it can be changed upstream, I think Microsoft would want Codespaces to work well on mobile browsers as well. The fewer patches we have to maintain the better!

html5syt commented 10 months ago

Sorry,I have too things to do...

I will try your solutions next week. And imagine if we can use Vscode locally and coding everywhere without computer, What a wonderful way this will be!

html5syt commented 10 months ago

add this to your seeting.json

{
    "keyboard.dispatch": "keyCode"
}

@zongou Thank you!Your solution work!

https://github.com/coder/code-server/assets/53525043/79b1a155-9599-44a3-8e3f-6b3e4ca095d9