pub enum Input {
Start,
Stop,
KeyDown {
key: KeyCode,
},
KeyUp {
key: KeyCode,
},
CustomEvent {
name: CompactString,
args: VecMap<CompactString, SimpleValue, false>,
interrupt: bool,
max_queue: usize,
},
}
Expand description
Simulates input from the user.
Variants§
Start
Simulate pressing the start (green flag) button. This has the effect of interrupting any running “on start” scripts and restarting them (with an empty context). Any other running processes are not affected.
Stop
Simulate pressing the stop button. This has the effect of stopping all currently-running processes. Note that some hat blocks could cause new processes to spin up after this operation.
KeyDown
Simulates a key down hat from the keyboard. This should be repeated if the button is held down.
KeyUp
Simulates a key up hat from the keyboard. Due to the nature of the TTY interface, key up events are not always available, so this hat does not need to be sent. If not sent, a timeout is used to determine when a key is released (sending this hat can short-circuit the timeout).
CustomEvent
Trigger the execution of a custom event (hat) block script with the given set of message-style input variables.
The interrupt
flag can be set to cause any running scripts to stop and wipe their current queues, placing this new execution front and center.
The max_queue
field controls the maximum size of the context/schedule execution queue; beyond this size, this (and only this) execution will be dropped.