Open UE2020 opened 2 months ago
If you want to enter text, you should always use the text()
method. Entering individual keys is slower and -at least for now - can lead to inconsistent or unexpected behavior. I need to improve it
The text()
method isn't a solution for me because I'm using enigo in a remote desktop app, where keys should be held for as long as the client on the other end holds them. Right now I think get_layoutdependent_keycode
is at fault.
@pentamassiv I fixed the issue in my project by replacing the get_layoutdependent_keycode
function with a hardcoded match statement from this C function. Obviously this means that only ascii characters can be emulated with Key::Unicode
, but that doesn't matter for my usecase. You can see the changes I made at my fork of enigo.
Describe the bug On Windows & Linux, calling
enigo.key(Key::Shift, Press)
followed byenigo.key(Key::Unicode("1"), Press)
produces an exclamation mark in a textarea. On MacOS, a number one is produced. This is reproducible only with numbers (shift + any letter produces the expected uppercase letter).Expected behavior Holding shift and a number should produce the special character associated with that combination regardless of the OS.
Environment