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

Windows Host / Sway Client: Keyboard prints wrong characters #3

Closed
Telkhine opened this issue Apr 1, 2021 · 6 comments
Closed

Windows Host / Sway Client: Keyboard prints wrong characters #3

Telkhine opened this issue Apr 1, 2021 · 6 comments

Comments

@Telkhine
Copy link

Telkhine commented Apr 1, 2021

What works

  • Mouse works fine. Left click, right click and mouse wheel all tested fine.
  • copy/paste works as well, both from host to client and client to host.

What doesn't work

The keymap translation between my Windows host and Sway client seems to be messed up. a becomes u, s becomes i, etc.

On the linux/sway side, I ran setxkbmap -print > ~/.config/waynergy/xkb_keymap, which gives:

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

I use a standard 105 key US keyboard. Nothing fancy. Is there anything on windows that I would need to change? Is windows even supported here?

EDIT:
On the host I'm running barrier 2.3.3

@r-c-f
Copy link
Owner

r-c-f commented Apr 1, 2021

For UNIXy platforms it's been easier to pass the raw scancodes and let xkb use the pre-existing mappings; this is probably a good reason to see if xkb will tolerate an xkb_keycodes section using the platform-agnostic Synergy key IDs at some point in the next few days.

@r-c-f
Copy link
Owner

r-c-f commented Apr 1, 2021

...and indeed writing an xkb mapping to accept arbitrary UTF32 is probably not going to happen. However, using
this keycodes section does work for me -- with that in ~/.xkb/keycodes/win and

xkb_keymap {
	xkb_keycodes  { include "win+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

as the keymap configuration I was able to get it to work with a Windows primary. Some keys are missing (I don't actually own a working full-sized keyboard it would seem) but the relevant keycodes can be found in wev or xev or the like.

@Telkhine
Copy link
Author

Telkhine commented Apr 1, 2021

That seems to work. Thanks for the assist!

EDIT:
For posterity: The right arrow key wasn't working, so I had to change the <RIGHT> symbol to <RGHT>, which I was able to figure out by looking at /usr/share/X11/xkb/symbols/inet.

@Telkhine Telkhine closed this as completed Apr 1, 2021
@r-c-f
Copy link
Owner

r-c-f commented Apr 6, 2021

@dankles I've added a slightly more complete one as https://github.com/r-c-f/waynergy/blob/master/doc/xkb/keycodes/win which fixed that as well as the numpad.

@char
Copy link

char commented Nov 22, 2021

This works, but it still emits the wrong characters if you're typing into an XWayland window for some reason :(

@r-c-f
Copy link
Owner

r-c-f commented Nov 22, 2021

I've updated the example windows key map to use an offset of 7, which should placate X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants