swarm/example
Brent Yorgey 599225f4d6
Key input handler (#1214)
Ability to code your own input handler routines.  Closes #102 .  Fixes #1210 .

* Adds a new type `key` to represent keypresses
* Adds a primitive function `key : text -> key` which can handle usual letters, numbers, etc. as well as special keys like `"Down"` etc, as well as modifier key prefixes like `key "A-C-Del"`.  `swarm generate keys` generates a list of all recognized special key names.
* New command `installKeyHandler : text -> (key -> cmd unit) -> cmd unit` which sets the "current key handler".  The `text` value is a hint line to display in the secondary key hints menu while the handler is running.  The global shortcut `M-k` toggles the currently installed handler.
* Add a `keyboard` device to provide these commands, as well as a `key` entity (the recipe for a `keyboard` is 16 `key`s + 1 `board`).
* Add a few examples in the `examples` folder.
* Add an installed `keyboard` to the `building-bridges` challenge.
2023-04-25 16:39:59 +00:00
..
BFS-clear.sw Meeting other robots (#920) 2022-12-22 20:36:11 +00:00
cat.sw rename unit type to unit (#697) 2022-09-26 20:10:12 +00:00
dfs.sw rename unit type to unit (#697) 2022-09-26 20:10:12 +00:00
fact.sw rename unit type to unit (#697) 2022-09-26 20:10:12 +00:00
list.sw Fix typos (#850) 2022-11-11 15:00:55 +00:00
multi-key-handler.sw Key input handler (#1214) 2023-04-25 16:39:59 +00:00
pilotmode.sw Key input handler (#1214) 2023-04-25 16:39:59 +00:00
wander.sw rename unit type to unit (#697) 2022-09-26 20:10:12 +00:00