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

Added GlobalHotKeysWithOptions class #492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StephenArg
Copy link

@StephenArg StephenArg commented Jul 22, 2022

This optional dict currently checks for an 'any_press' value and runs all the functions in the provided list. Let me know if this is less cluttered for you. This seems better than adding a whole new wrapper class that does the same the GlobalHotKeys does except for being able to run functions after every press.

Edit: I realized changing the arguments in the main class could be a breaking change for those using the *args and **kwargs for that class. I went with your suggestion of making a new class with similar functionality. It was a better idea.

What do you think?

@StephenArg StephenArg changed the title Added optional GlobalHotKeys options argument Added GlobalHotKeysWithOptions class Jul 22, 2022
HotKey(HotKey.parse(key), value)
for key, value in hotkeys.items()]
HotKey(HotKey.parse(key), func)
for key, func in hotkeys.items()]
Copy link
Author

Choose a reason for hiding this comment

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

I also renamed value to func for clarity

@StephenArg StephenArg force-pushed the GlobalHotKeys-add-options-argument branch from 6a11ae2 to b4e5150 Compare July 22, 2022 21:21
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.

1 participant