Skip to content

Improve Unsubscribe methods #36

@Empiree

Description

@Empiree

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);

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions