Narsil / rdev

Simple library to listen and send events to keyboard and mouse (MacOS, Windows, Linux)
MIT License
536 stars 135 forks source link

Problem with diacritical marks in Windows with the Spanish keyboard. #77

Open 0mcandal0 opened 2 years ago

0mcandal0 commented 2 years ago

There is a problem with the library when I try to make diacritical marks on the keyboard.

For example, if I try to type the character Á the library interferes and does not show the expected value. In another case the character ü becomes ú.

The tests have been done on a PC with Windows 10 operating system and with the latest available version of the library and running the grab.rs example.

Narsil commented 2 years ago

Hi, sorry for the very late reply, GH wasn't giving me notifications here.

I'm not sure I understand your issue.

You're grabbing the keyboard, and it's messing up your keystrokes meaning it's not key logging properly ? I would have to check, but the code is as much as possible receiving and sending back keystrokes as they happen... So I'm not sure what's going on.

If you could share a working example that might help. (I don't have a windows handy, but I could try and take a look sometime)

0mcandal0 commented 2 years ago

Here is the link to how I fixed the problem for my particular case.

https://github.com/Narsil/rdev/commit/1420b03bc360d86543ccfbe29c8577e3dd1f74d0

As you can see, I commented the call to set_global_state before the get_code_name function and I controlled the behaviour of last_state from this last method.

This way the retrieval of the keystrokes is correct.

Narsil commented 2 years ago

Really interesting, thanks !