OpenComputers II

OpenComputers II

27.1k Downloads

[BUG] Projector (+Keyboard) not using correct keyboard layout

Shazuli opened this issue ยท 3 comments

commented

Hi

I noticed the keyboard for the Projector in conjunction with the Keyboard block has the wrong layout. Pressing some keys writes out the wrong character. The Computer block does not seem to have the wrong keyboard layout.

commented

The terminal uses the character input events GLWF produces, so it uses the client's system layout. The keyboard uses the keycodes because it emulates an actual keyboard (because AFAIK it has to, to make it work on the framebuffer terminal). So it uses the layout from the Linux running in the VM on the server.

I'm not sure there's a (non-horrible) way around this.

commented

I'm not super familiar with the linux image used on OC2 and how exactly the parts work, but shouldn't it just be configurable like with a regular computer? I'm not on my PC atm but if loadkeys is available that could be used to set the keymap. /etc/vconsole.conf might also work, but not sure if that's automatically used.

Maybe its possible to somehow make an API that gives VMs the current keyboard layout and a script that queries it and loads it?

(See also https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration)

commented

Possibly, though I don't know if buildroot has an option for that, and if so, no intuition for how big those files would be. Also it'd not be automatic, which I realize I didn't clearly express as my main concern. I don't think automating this would be feasible, since multiple uses with different local keymaps might use the same machine at once in multiplayer.

If keymaps are not huge, so it's reasonable to embed at least "common" ones, that'd be a good enough solution for my tastes, though. If someone wants to look into that, that'd be much appreciated.