Skip to content

Added GlobalHotKeysWithOptions class#492

Open
StephenArg wants to merge 1 commit intomoses-palmer:masterfrom
StephenArg:GlobalHotKeys-add-options-argument
Open

Added GlobalHotKeysWithOptions class#492
StephenArg wants to merge 1 commit intomoses-palmer:masterfrom
StephenArg:GlobalHotKeys-add-options-argument

Conversation

@StephenArg
Copy link
Copy Markdown

@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
Copy Markdown
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