Skip to content

Is there a way to only execute the command one time when you hold the keybind? #4916

Answered by nightwing
zeozeozeo asked this question in Q&A
Discussion options

You must be logged in to vote

Ace does not have a way to register commands only for key down, but one workaround is to use

if (window.event && window.event.repeat) return

before calling saveFile,
That said, i think most editors simply use save state to prevent repeated calls and don't distinguish between first and repeated calls.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andrewnester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants