The keys and buttons a desktop player holds, as the input message the server takes.
input = Cauldron2D.Wx.Input.new(%{?A => :left, 315 => :jump, {:mouse, :left} => :act}, steering: [:left, :right])
{input, handled?} = Cauldron2D.Wx.Input.press(input, ?A)
Cauldron2D.Wx.Input.state(input)Keys are wx key codes (?A, 32, 315 for the up arrow); buttons {:mouse, :left | :right | :middle}.
A held key of a steering action clears the aim, so the keys take over from the pointer
until it moves again, as the other clients do.
Summary
Functions
The pointer moved to a world position.
A mouse button went down or up.
Every key let go, as when the window loses focus.
An input reading keymap; :steering names the actions the pointer also drives.
A key went down; {input, whether the key meant anything}.
A key came up; {input, whether the key meant anything}.
What to send: the actions held, by name, and the aim as a pair.
Types
Functions
The pointer moved to a world position.
A mouse button went down or up.
Every key let go, as when the window loses focus.
An input reading keymap; :steering names the actions the pointer also drives.
A key went down; {input, whether the key meant anything}.
A key came up; {input, whether the key meant anything}.
What to send: the actions held, by name, and the aim as a pair.