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

Update documentation to help explain sequences clearer #141

Open
abritabroad opened this issue Aug 25, 2022 · 3 comments
Open

Update documentation to help explain sequences clearer #141

abritabroad opened this issue Aug 25, 2022 · 3 comments

Comments

@abritabroad
Copy link

I spent a few days digging through the code in order to figure out why my sequences were not working properly.

If you are trying to achieve the following scenario, the "g" command always wins.

[
    {
        key: ["g"],
        command: (output: ShortcutEventOutput) => console.log("g", output),
    },
    {
        key: ["g a"],
        command: (output: ShortcutEventOutput) => console.log("g a", output),
    }
]

If you add a trailing 'space' to to the first command's key, it will be treated as a sequence and the "g a" combination wins.

[
    {
        key: ["g "],   // <- Add trailing space here
        command: (output: ShortcutEventOutput) => console.log("g", output),
    },
    {
        key: ["g a"],
        command: (output: ShortcutEventOutput) => console.log("g a", output),
    }
]


Thanks!

@omridevk
Copy link
Owner

@abritabroad
Copy link
Author

Yes, there is no mention if needing a trailing space on the single key in order to get the double key's to work.

@omridevk
Copy link
Owner

I think that's more of a bug rather than a feature, i'll need to think about this. but the "g a" sequence suppose to win

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

No branches or pull requests

2 participants