kaliiiiiiiiii/Selenium-Driverless

[feature request] `send_keys` non-en_US keyboard layout support

Opened this issue · 4 comments

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.

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

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

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.