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

Using pynput instead of pyautogui #10

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Using pynput instead of pyautogui #10

merged 1 commit into from
Dec 28, 2023

Conversation

uberkael
Copy link
Contributor

Hi,
Nice project!

I have a custom keyboard layout and PyAutoGUI can't handle some non-English keyboards (mine is not even a standard one) check here asweigart/pyautogui#137.
I did try some alternatives (like using keyboard that is already imported) but I settled with pynput.
Because you were using some delay between keys I created a helper function but if for some reason it won't be needed it can be as simple as:
pyinput_keyboard.type(transcribed_text)

I also had trouble with the sample rate (Linux Pipewire) but I solved it for another PR (maybe).

Thanks!

@uberkael
Copy link
Contributor Author

uberkael commented Jul 23, 2023

The keyboard library requires to use root on Linux (at least).
This can be avoided by replacing this line:
keyboard.add_hotkey(config["activation_key"], on_shortcut)
like here https://pynput.readthedocs.io/en/latest/keyboard.html#global-hotkeys

If this request (and pynput) is accepted it can help to deal with that.

@savbell
Copy link
Owner

savbell commented Dec 28, 2023

Hi, thanks for your PR! Apologies for not reviewing it until now. I appreciate you fixing the issue with non-English keyboards! :)

I don't have the time to test on Linux (I created this project for my personal use and didn't expect anyone else to use it, haha!), but feel free to create another PR to change to using the pynput global hotkeys instead!

@savbell savbell merged commit 358b764 into savbell:main Dec 28, 2023
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

Successfully merging this pull request may close these issues.

2 participants