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

Swap() method for KeyboardBinder #17

Closed
nullptrException100 opened this issue Mar 10, 2024 · 1 comment
Closed

Swap() method for KeyboardBinder #17

nullptrException100 opened this issue Mar 10, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@nullptrException100
Copy link
Contributor

I propose to create a small method that will change button bindings between each other.

keyboardBinder.Swap(Key.Q, Key.W)

Instead of

keyboardBinder.Bind(Key.Q, Key.W);
keyboardBinder.Bind(Key.W, Key.Q);

But you need to consider the fact that one of these buttons may already be with a different bind. We need to think about what behavior is needed in such a scenario.

@Empiree Empiree added enhancement New feature or request good first issue Good for newcomers labels Mar 10, 2024
@Empiree
Copy link
Owner

Empiree commented Mar 10, 2024

Good idea. I think the behavior should be the same if we call these 2 methods separately. If a button already has a different bind, it will simply change to the one we need, just like in the case of calling the Bind method.

Since this is a method for convenience. It should be added to the KeyboardBinder class directly

@Empiree Empiree removed the enhancement New feature or request label Mar 13, 2024
@Empiree Empiree closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants