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

[feature request] send_keys non-en_US keyboard layout support #207

Open
namtacs opened this issue Apr 18, 2024 · 4 comments
Open

[feature request] send_keys non-en_US keyboard layout support #207

namtacs opened this issue Apr 18, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@namtacs
Copy link

namtacs commented Apr 18, 2024

For example:
await input.send_keys("Иван")
does nothing

here it checks if the char in present in mappings

but if it isn't then it just silently ignores it.
I suggest sending the appropriate keycodes for the selected keyboard layout, autogenerating mappings (somehow) or raising an error.

@kaliiiiiiiiii
Copy link
Owner

kaliiiiiiiiii commented Apr 18, 2024

For example: await input.send_keys("Иван") does nothing

here it checks if the char in present in mappings

but if it isn't then it just silently ignores it.
I suggest sending the appropriate keycodes for the selected keyboard layout, autogenerating mappings (somehow) or raising an error.

Yeah, at least an Exception would be expected indeed.
My plan is (long-term), to implement different keyboard layouts. For now however, you might use elem.write() instead

EDIT

I'll be updating the US keyboard layout by using the following sources as a guideline

microsoft/playwright#7396 (comment) for reference on the keyboard layouts to support and generate_keyboard_layouts.js to generate keyboard layouts

@kaliiiiiiiiii kaliiiiiiiiii changed the title send_keys doesn't work with non-english letters [feature request] send_keys non-en_US keyboard layout support Apr 18, 2024
@kaliiiiiiiiii kaliiiiiiiiii added the enhancement New feature or request label Apr 18, 2024
@kaliiiiiiiiii kaliiiiiiiiii changed the title [feature request] send_keys non-en_US keyboard layout support [feature request] send_keys non-en_US keyboard layout support Apr 18, 2024
@boludoz
Copy link
Contributor

boludoz commented Apr 28, 2024

Add send_keys in a simple way and that's it or are you a psychopath?

@boludoz
Copy link
Contributor

boludoz commented Apr 28, 2024

#191

@kaliiiiiiiiii
Copy link
Owner

Add send_keys in a simple way and that's it or are you a psychopath?

it's not just simple way.
The code you've provided at https://github.com/kaliiiiiiiiii/Selenium-Driverless/pull/191/files#diff-eb355e1147cb9c933fac6232a336122a60ef8bafb5a2661496aeb58ba142f741R488 is highly detectable and doesn't even work when keydown//keyup events are required.

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

No branches or pull requests

3 participants