PROPHET/OS
NAME
hi: prophetHI's tool
SYNOPSIS
hi [watch <ms>] [action <bindings> <ms>] [calibrate <player>] [rumble <player>] [pads <ms>]
DESCRIPTION
ProphetHI's tool. Without an argument it lists the device kinds this build carries (keyboard, mouse) and whether each opened on this console. A program asks ProphetHI for actions, never for keys (lib/hi, <hi/hi.h>); its bindings come from <home>/.hi.conf before /system/config/hi.conf before the program's own, a line <program>.<action> key.space,mouse.left each (<program>.<action>.<player> for another player).
watch opens the console's event ring (POS_CON_EVENT_RING) and prints every key for that many milliseconds: its binding name (key.left, key.a, key.space), down or up, and the microseconds between the kernel taking it and this program reading it, then the mean and the worst. A key over the serial line comes without its release.
A gamepad's controls are pad.b1 .. pad.b32, the axes pad.x, .y, .z, .rx, .ry, .rz with their halves pad.x-, pad.x+ and so on, and the hat as pad.up, .down, .left, .right; player n's as pad<n>.. Each stick reads through a round dead zone and a curve: pad.deadzone 12 (percent) and pad.curve 1 (1 to 3) in hi.conf, pad2.deadzone for one player alone. Before the zone each stick axis is measured against its middle at rest, pad.center.x (.y, .rx, .ry) in 1/65536; hi calibrate <player> measures them with the sticks left alone for a second and writes them into the own hi.conf, its other lines kept. Each stick is also four arrows, pad.stick.left (.right, .up, .down) and pad.rstick.*, down past pad.threshold 50 (percent) and up again below four fifths of it.
action binds one action at run time (hi_binding_set) to the bindings given, such as key.space,mouse.left, and prints each time it goes down or up for that many milliseconds.
hi rumble <player> lets that player's pad rumble a second with both motors full: whether it has motors is felt, since these pads do not answer the question. hi lists each pad with its rumble as the pad or its protocol says it. hi also says each pad's light as it was last sent (1 flashes then on).
hi pads <ms> is the pad test of a machine: each pad's light, then a second of rumble per pad with the motor reports the pad took, then for that many milliseconds every button pressed, each axis's range and the hat's directions, one summary line per pad. The rumble is felt and the lights are seen; the lines say what the pads took.
EXAMPLE
$ hi gamepad open keyboard open mouse open