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

Add an option for continuous recording. #396

Open
AndriySvyryd opened this issue Oct 1, 2017 · 0 comments
Open

Add an option for continuous recording. #396

AndriySvyryd opened this issue Oct 1, 2017 · 0 comments

Comments

@AndriySvyryd
Copy link

AndriySvyryd commented Oct 1, 2017

Currently Mousetrap.record will only record one sequence. For my scenario it would be useful to keep recording the key sequences until canceled ( Mousetrap.stopRecord)

A naïve workaround of starting recording again in the callback doesn't work as the state is cleared after the callback is called:

recordKey() {
    Mousetrap.record(keys => {
        console.log(keys.join(' '));
        this.recordKey();
    });
}
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

1 participant