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

Modifiers #12

Open
Apostolique opened this issue Mar 22, 2021 · 0 comments
Open

Modifiers #12

Apostolique opened this issue Mar 22, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Apostolique
Copy link
Owner

Apostolique commented Mar 22, 2021

In some cases, some keys shouldn't trigger Pressed or Released. For example: CTRL + A.

If we're currently holding A, then pressing CTRL shouldn't trigger a CTRL + A press.

ICondition SelectAll =
    new AllCondition(
        new KeyboardCondition(Keys.LeftControl),
        new KeyboardCondition(Keys.A)
    );

In a select all CTRL is a modifier. A new class could be created handle that case:

ICondition SelectAll =
    new AllCondition(
        new Modifier(
            new KeyboardCondition(Keys.LeftControl)
        ),
        new KeyboardCondition(Keys.A)
    );

Modifier would always return false for Pressed and Released.

Note: There might be an edge case to think about. What happens if a user is currently pressing A then presses CTRL, Should that trigger Held and HeldOnly for CTRL + A? It might make some code harder to write on the user side.

@Apostolique Apostolique added the enhancement New feature or request label Jun 26, 2021
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