enigo icon indicating copy to clipboard operation
enigo copied to clipboard

linux: wayland: The Shift key does not work

Open pentamassiv opened this issue 2 years ago • 2 comments

Describe the bug Entering keys such as Key::Shift does not work.

To Reproduce Run the following code:

use enigo::{Enigo, Key, KeyboardControllable};
use std::thread;
use std::time::Duration;

fn main() {
    thread::sleep(Duration::from_secs(2));
    let mut enigo = Enigo::new();

    // write text
    enigo.key_sequence("Hello World! here is a lot of text  ❤️");

    enigo.key_down(Key::Shift);
    enigo.key_click(Key::Layout('a'));
    enigo.key_up(Key::Shift);
}

with the feature wayland enabled.

Expected behavior The text should get entered, followed by an 'A'.

Environment (please complete the following information):

  • OS: Linux
  • Library Version: commit e7fa6dfdb22c993b903fce113ae66ee1acd17fbe

pentamassiv avatar Sep 18 '23 15:09 pentamassiv

I suspect this is because of the keymap we provide. Shift probably is entered but the keymap has the same keycode for both layers.

pentamassiv avatar Oct 01 '23 19:10 pentamassiv