Currently, blocks/methods registered to the key handler are executed repeatedly, if the user presses and holds the key. While this is a sensible behavior in some cases, it might be useful to add an option to limit this to a single execution per keystroke.
self gmRegisterToKeyHandler.
self
gmRegisterBlock: [
"`Hello` is printed only once, even if the user presses and holds the
space bar for multiple `stepTime` intervals."
Transcript show: 'Hello'.
]
forKey: Character space
once: true.
self
gmRegisterRegisterMethodInvocation: handleKey
on: self
forKey: Character space
once: true.
Currently, blocks/methods registered to the key handler are executed repeatedly, if the user presses and holds the key. While this is a sensible behavior in some cases, it might be useful to add an option to limit this to a single execution per keystroke.