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

Improve Unsubscribe methods #36

Open
Empiree opened this issue Apr 9, 2024 · 0 comments
Open

Improve Unsubscribe methods #36

Empiree opened this issue Apr 9, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Empiree
Copy link
Owner

Empiree commented Apr 9, 2024

Add an overload of the Unsubscribe() method to unsubscribe from multiple keys.

In the KeyboardListener class we have convenient methods for unsubscribing by key, but nothing for unsubscribing from multiple related keys. For example, for combinations of.

I would like to implement an Unsubscribe() method overload that supports this. But we need to do it in a way that is convenient and doesn't confuse people. Because we can have a collection of single keys as well as collections of combinations and sequences.

There is an option, but I think we can come up with a better solution.

var keyboardListener = new KeyboardListener();

Key[] keys = [Key.LeftCtrl, Key.V];

keyboardListener.SubscribeCombination(keys, _ => { });
keyboardListener.Unsubscribe(keys, UnsubscribeOption.Combination);
@Empiree Empiree added enhancement New feature or request good first issue Good for newcomers labels Apr 9, 2024
@Empiree Empiree self-assigned this Apr 12, 2024
@Empiree Empiree changed the title Improving Unsubscribe methods Improve Unsubscribe methods Apr 13, 2024
@Empiree Empiree removed the good first issue Good for newcomers label Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant