src/virtio/input.bend checks
raw source on the hub · import 0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/input.bend as Input
4 imports
import Base import ../lib/bytes.bend as B import ../vmm/abi.bend as V import ./queue.bend as Q
Types
type Hid source · line 26 · raw
Data
What the host saw: a key (a Linux key code; 0 is no key), the pointer at (x, y) scaled to 0..32767, a mouse button (0 left, 1 right, 2 middle).
HidKey@code:U32 -> @down:Bool -> Hid
HidMove@x:U32 -> @y:U32 -> Hid
HidButton@button:U32 -> @down:Bool -> Hid
type InputState source · line 32 · raw
Data
The device's selector and the events not yet delivered, oldest first.
InputState@sel:U32 -> @subsel:U32 -> @events:List<&2, List<&2, U32>> -> InputState
type InRx source · line 36 · raw
Data
What an eventq pass did.
InRx@s:InputState -> @q:0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq -> @used:Bool -> InRx
Definitions
def Input.max_events source · line 39 · raw
Nat
def InputState.new source · line 42 · raw
InputState
def Input.event source · line 45 · raw
@t:U32 -> @code:U32 -> @value:U32 -> List<&2, U32>
def Input.syn source · line 48 · raw
List<&2, U32>
def Input.events.kbd source · line 52 · raw
@ev:Hid -> List<&2, List<&2, U32>>
The events of one report on the keyboard (tablet False) or the tablet.
def Input.events.tablet source · line 61 · raw
@ev:Hid -> List<&2, List<&2, U32>>
def Input.events source · line 70 · raw
@tablet:Bool -> @ev:Hid -> List<&2, List<&2, U32>>
def Input.push source · line 78 · raw
@tablet:Bool -> @s:InputState -> @ev:Hid -> InputState
Queues the events of a report, keeping the last Input.max_events().
def Input.name source · line 87 · raw
@tablet:Bool -> List<&2, U32>
def Input.devids source · line 94 · raw
@tablet:Bool -> List<&2, U32>
def Input.key_bits source · line 99 · raw
List<&2, U32>
Key codes 1..247: bit 0 clear, then 247 set bits.
def Input.ev_bits source · line 102 · raw
@tablet:Bool -> @+subsel:U32 -> List<&2, U32>
def Input.abs_info source · line 109 · raw
@tablet:Bool -> @+subsel:U32 -> List<&2, U32>
def Input.payload source · line 117 · raw
@+tablet:Bool -> @+sel:U32 -> @+subsel:U32 -> List<&2, U32>
The union's bytes for a selector.
def Input.config source · line 123 · raw
@tablet:Bool -> @+sel:U32 -> @+subsel:U32 -> List<&2, U32>
def InputState.config source · line 130 · raw
@tablet:Bool -> @s:InputState -> List<&2, U32>
The config space of a state.
def Input.select source · line 137 · raw
@s:InputState -> @+off:U32 -> @+v:U32 -> InputState
A driver write of v at config byte off (0 select, 1 subsel; others are read-only).
def Input.rx.serve source · line 146 · raw
@-R:Type -> @q:0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq -> @c:0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Chain -> @ev:List<&2, U32> -> 0xdc471a3e39bb19b0178a5b112a57aa93/src/vmm/abi.Op<R, 0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq>
Writes one event into a chain and pushes it used.
def Input.rx.step source · line 153 · raw
@-R:Type -> @sel:U32 -> @sub:U32 -> @r:Pair(0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq, Maybe<&2, 0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Chain>) -> @ev:List<&2, U32> -> @rest:List<&2, List<&2, U32>> -> @used:Bool -> @k:(@_:Pair(0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq, List<&2, List<&2, U32>>) -> 0xdc471a3e39bb19b0178a5b112a57aa93/src/vmm/abi.Op<R, InRx>) -> 0xdc471a3e39bb19b0178a5b112a57aa93/src/vmm/abi.Op<R, InRx>
def Input.rx.go source · line 163 · raw
@fuel:Nat -> @-R:Type -> @+sel:U32 -> @+sub:U32 -> @st:Pair(0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq, List<&2, List<&2, U32>>) -> @used:Bool -> 0xdc471a3e39bb19b0178a5b112a57aa93/src/vmm/abi.Op<R, InRx>
def Input.rx source · line 181 · raw
@-R:Type -> @s:InputState -> @q:0xdc471a3e39bb19b0178a5b112a57aa93/src/virtio/queue.Vq -> 0xdc471a3e39bb19b0178a5b112a57aa93/src/vmm/abi.Op<R, InRx>
Delivers pending events into eventq, one per available chain (at most num), until they run out. Answers the state with the events left, the queue, and whether any chain was used.
def InputState.pending source · line 187 · raw
@s:InputState -> Nat
The number of events not yet delivered.