# input_arrows.ludic — the arrow keys in the held-key set. Key.Up/Down/Left/Right are # 128-131, the codes the platform stores an arrow under; they used to fold to w/s/a/d, # so Input.key_down(Key.Up) read the W bit and Input.move_i ignored the arrows. Driven # headless by injection, the same way the #50 device tests are. # # Deterministic; a full run prints: 128 129 130 131 1 0 -1 1 0 program InputArrows { function bi(b: bool) -> int { if b { return 1 }; return 0 } entry { print(Key.Up) print(Key.Down) print(Key.Left) print(Key.Right) Input.press(Key.Up) # hold the up arrow Input.poll() print(bi(Input.key_down(Key.Up))) # 1 — the arrow is held print(bi(Input.key_down('w'))) # 0 — and it is not W let m = Input.move_i() print(m.y) # -1 — move_i takes the arrows as well as WASD Input.release(Key.Up) Input.press(Key.Right) Input.poll() let r = Input.move_i() print(r.x) # 1 print(bi(Input.key_down(Key.Up))) # 0 — released } }