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

How to stop Keyboard.hook hooking keyboard.send or keyboard.write? #636

Open
CherryBerryKiwi opened this issue Feb 20, 2024 · 0 comments
Open

Comments

@CherryBerryKiwi
Copy link

CherryBerryKiwi commented Feb 20, 2024

On the Windows 10 system, everything is working very well. However, on Linux, keyboard.hook(on_key_event) not only hooks the user's input but also hooks keyboard.send or keyboard.write, sometimes leading to an infinite loop.

For example, if the user types 'IA', then I want the script to send 'Backspace*2' and rewrite 'ÎA'. Here, the library again hooks the 'A' sent by keyboard.write and falls into an infinite loop.

I have a workaround for Linux only, that I read the device id of user's real keyboard and the keyboard library to exclude. However, this does not work every time.

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

No branches or pull requests

1 participant