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

Linux wayland with custom keyboard layout (colemak) the characters are not taking the layout into account #302

Open
dkuku opened this issue Jul 18, 2024 · 2 comments

Comments

@dkuku
Copy link

dkuku commented Jul 18, 2024

Describe the bug
This text:
abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
is pasted as:
abcsftdhuneimky;qprglvwxjz1234567890ABCSFTDHUNEIMKY:QPRGLVWXJZ
Changing to qwerty fixes the issue.
To Reproduce
Change the keyboard layout to colemak
My code is basic - is was the same on some older version of the crate, I upgraded to lastest nad nothing changed. Printing it is ok.

                    let mut enigo = Enigo::new(&Settings::default()).unwrap();
                    println!("{}", text);
                    let _ = enigo.text(&text);

Expected behavior
Works

Environment (please complete the following information):

  • OS: Linux Gnome Wayland with custom keyboard layout
  • Rust rustc 1.79.0 (129f3b996 2024-06-10)
  • Library Version 0.2.1 (tested also on 0.0.14)

Additional context
Add any other context about the problem here.

@dkuku
Copy link
Author

dkuku commented Jul 19, 2024

I found in the docs that I should use Keyboard::key

@dkuku dkuku closed this as completed Jul 19, 2024
@pentamassiv pentamassiv reopened this Aug 1, 2024
@pentamassiv
Copy link
Collaborator

I reopened the issue, because using the text method was correct. Keyboard::key is only intended to be used when your intention is to press or release a key (e.g press SHIFT). If I understood correctly, you want to type text and don't really care which (or if any) keys are pressed or released.

The reason why the wrong characters are entered is probably because right now a hard-coded keymap is used and that probably conflicts with Colemak. I am surprised though that the text_input protocol was not used. Which DE do you use?

The situation with text input on Wayland is still quite messy. I need to improve enigo a lot to get it working properly :S

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

No branches or pull requests

2 participants