Enum netsblox_vm::project::Input
source · pub enum Input {
Start,
Stop,
KeyDown(KeyCode),
KeyUp(KeyCode),
}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(KeyCode)
Simulates a key down hat from the keyboard. This should be repeated if the button is held down.
KeyUp(KeyCode)
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).