-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use active keymap instead of hard-coding English qwerty #2
Comments
First I have a question, since we're emulating a new input device, does Linux kernel support different keyboards in different layouts? I don't have much time to have a deep look, but a quick search shows (at least) X11 and Wayland supports this. I'm not sure whether this can be achieved in text console. |
Yes;
The best way would be to load the currently-active translation table, no matter whether we are running on a vconsole, under X11, or under Wayland. They each handle their own keyboard mappings though. Therefore perhaps a good way to handle this is go back to the roots, use the vconsole keyboard layout as a lowest common denominator, and hope users configure their X/Wayland keymaps to match their console keymaps. |
+1 for this, I'm currently looking to replace xdotool with ydotool (mainly for my pass autotype script) and switching to wayland. Unfortunately this issue prevents me to do this at the moment, since e.g. z is typed as y and vice versa (I'm on a german keymap as well). I would also be Ok with using the vconsole keymap for this purpose. |
If anyone has any idea on how to get this issue solved, pull requests are always welcomed. We're currently moving to a new city and probably don't have time to deal with this in a month or so. |
I have scratched my itch in the meantime; check out uinputchars. @seiichiro0185, this should fully address your use case, which exactly matches mine. @ClassicOldSong, if it helps you, I can refactor my code into a library. |
@piater wow looks great, I'll check it out later |
Resource.cpp
currently hard-codes an English qwerty keyboard mapping. For example,@
is represented as Shift-2. Thus, if a German qwertz keyboard mapping is active where Shift-2 is=
,ydotool type @
results in=
being typed.Perhaps one way forward is to follow the example of
dumpkeys
.The text was updated successfully, but these errors were encountered: