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

Add delays-characters package #152

Merged
merged 5 commits into from
Jan 15, 2025
Merged

Add delays-characters package #152

merged 5 commits into from
Jan 15, 2025

Conversation

smeech
Copy link
Collaborator

@smeech smeech commented Jan 14, 2025

An Espanso trigger that uses the Python pynput library to inject text, instead of Espanso. This enables the addition of pauses (sleep), <Tab> etc, and other key combinations not supported by Espanso.

An Espanso trigger that uses the Python `pynput` library to inject text, *instead* of Espanso. This enables the addition of pauses (sleep), \<Tab> etc, and other key combinations not supported by Espanso.
Added pynput installation instructions.
@smeech smeech changed the title delays-characters package Add delays-characters package Jan 14, 2025
@smeech
Copy link
Collaborator Author

smeech commented Jan 14, 2025

As this package includes a script, I would be grateful for someone else to cast an eye over it before we merge.

Copy link
Member

@AucaCoyan AucaCoyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
Would you mind specifying the minimal python version? (just the one in your computer, no need to be sure of the exact to the bug fix precision)

@smeech
Copy link
Collaborator Author

smeech commented Jan 14, 2025

Would you mind specifying the minimal python version?

What do you mean? pynput was initially released in 2015, so I guess it'll work with Python 3, but maybe Python 2. ChatGPT suggests Python 2.7 as the earliest.

I have Python 3.10.12.

Notes added to README.md.

and generating an error message to Espanso log if not present.

README.md updated to mention Python version.
@smeech
Copy link
Collaborator Author

smeech commented Jan 14, 2025

The package may provide a workaround for some with Issues e.g. espanso/espanso#1321, espanso/espanso#2079.

except ImportError:
import sys
print("Error: The 'pynput' library is not installed.", file=sys.stderr)
print("Install it using: pip install pynput", file=sys.stderr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

@AucaCoyan
Copy link
Member

Great! then it's 3.10. I want to stay as far as possible from python 2.7 or god forbid earlier versions.
It's a really tough dependency to have in 2025. We shouldn't support it. If it works, I'm okay with stating that in the Readme 👌🏼

@AucaCoyan AucaCoyan merged commit 706ac64 into espanso:main Jan 15, 2025
1 check passed
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