Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No keyboard layout switching is supported #205

Open
dluciv opened this issue Dec 23, 2022 · 2 comments
Open

No keyboard layout switching is supported #205

dluciv opened this issue Dec 23, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dluciv
Copy link

dluciv commented Dec 23, 2022

First, thank you for this great project!

In many languages, national characters require different keyboard layouts. But only single layout works at time. When trying to specify multiple ones (via sway config, environment or wayvnc config), it says: Multiple keyboard layouts have been specified, but only one is supported.

There are some workarounds possible, but they are pretty ugly and mostly unusable.

@dluciv
Copy link
Author

dluciv commented Dec 24, 2022

Workarounds

Then workarounds, just to make fun and possibly to borrow some ideas from hem.

With Sway (1)

  1. Launch sway with single layout and wayvnc.
  2. Change layout in sway config to somewhat like xkb_layout "us,ru" or us,el or us,ka or whatever you need.
  3. Use sway hotkey to reload settings, while still keeping wayvnc running.

Then, wayvnc notices nothing and layout can be switched, for example, from shell using swaymsg input "0:0:virtual_keyboard" xkb_switch_layout next (which can even be bound to a hotkey if needed). And it works from the first glance. Until you disconnect.

With Sway (2)

bindsym $mod+Alt+1 input "type:keyboard" xkb_layout us
bindsym $mod+Alt+2 input "type:keyboard" xkb_layout ru

Or similar setting. Also lets sway rule it all. Sway switches the layout, wayvnc continues working smoothly.

No layout switching at all

Not related to sway or any particular environment. The other funny workaround is to use no layout switching at all. One can launch two wayvnc instances with different configuration regarding keyboard layout. Connect to them both and Looks stupid, nearly unusable in practice, but works smoothly =).

@any1
Copy link
Owner

any1 commented Dec 24, 2022

Keyboard maps are used to look up a key on the keyboard that generates a particular symbol. If the chosen map contains the given symbol, things will mostly work, but it is not guaranteed that the "right" key will be pressed. For typing, this isn't really a problem, but it might be for other applications such as gaming.

There are clients such as TigerVNC and wlvncc that can send key codes directly instead of converting them to symbols. The best solution is to use such a client because that makes keyboard layouts completely irrelevant.

Anyway, if you want to implement layout switching, I suggest that you look into adding a command for it to wayvncctl.

@any1 any1 added enhancement New feature or request good first issue Good for newcomers labels Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants