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

isInitial in CommandCallback #78

Open
DennisSmolek opened this issue Apr 24, 2024 · 0 comments
Open

isInitial in CommandCallback #78

DennisSmolek opened this issue Apr 24, 2024 · 0 comments
Labels
bug Something isn't working useCommand
Milestone

Comments

@DennisSmolek
Copy link
Collaborator

DennisSmolek commented Apr 24, 2024

The isInitial flag lets us only listen to the first time a key is pressed vs the repeated tests the system will log.
It's correctly in the type but typescript says it's wrong.

useCommand(
	"Control",
	(info) => {
              //@ts-ignore this does exist?
              if (!info.isInitial) return;
		console.log("control pressed");
	},
	() => {
		console.log("control released");
	}
);
@DennisSmolek DennisSmolek added the bug Something isn't working label Apr 24, 2024
@DennisSmolek DennisSmolek added this to the 0.0 Alpha milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working useCommand
Projects
None yet
Development

No branches or pull requests

1 participant