Input
Keys, buttons and the mouse, from the game window’s messages, and keybinds.
Keybind
Section titled “Keybind”rebind(chords: Array<import("salamander").Given<Wraith.Chord>>): voidunbind(): voidchords(): Array<Wraith.Chord>next(): Promise<void>rebind(chords: (Wraith.Chord)[])unbind()chords(): (Wraith.Chord)[]next(): salamander.Promisevoid Rebind(System.ReadOnlySpan<Wraith.Chord> chords)void Unbind()Wraith.Chord[] Chords()System.Threading.Tasks.Task NextAsync(System.Threading.CancellationToken cancel = default)sal::Result<void, Wraith::KeybindError> rebind(std::span<const Wraith::Chord> chords) constvoid unbind() conststd::span<const Wraith::Chord> chords() constsal::Future<void, Wraith::KeybindError> next() constpub fn rebind(&self, chords: &[wraith::Chord]) -> Result<(), wraith::KeybindError>pub fn unbind(&self)pub fn chords(&self) -> &[wraith::Chord]pub fn next(&self) -> salamander::Future<(), wraith::KeybindError>fn rebind(self: Wraith.Keybind, chords: []const Wraith.Chord) (Wraith.KeybindError || rt.Failure)!voidfn unbind(self: Wraith.Keybind) voidfn chords(self: Wraith.Keybind) []const Wraith.Chordfn next(self: Wraith.Keybind) rt.Promise((Wraith.KeybindError || rt.Failure)!void, Wraith.KeybindErrorCode)uint32_t Wraith_Keybind_rebind(Wraith_Keybind self, Slice_Wraith_Chord chords)void Wraith_Keybind_unbind(Wraith_Keybind self)Slice_Wraith_Chord Wraith_Keybind_chords(Wraith_Keybind self)sal_Promise Wraith_Keybind_next(Wraith_Keybind self)rebind
Section titled “rebind”Replaces its keys and saves them, like picking them in Settings. Empty leaves it without one.
Fails with KeybindError. Uses Chord.
unbind
Section titled “unbind”Its keys stay saved for next time.
chords
Section titled “chords”Its keys now, including the player’s picks. Good till the thread’s next call into Wraith.
Uses Chord.
Its next press, carrying on on the thread that asked. Unavailable once it’s unbound.
Async. Fails with KeybindError.
Get it with Api.input().
keyDown(key: Wraith.Key | Wraith.KeyName): booleanbuttonDown(button: Wraith.MouseButton | Wraith.MouseButtonName): booleanmousePos(): Wraith.Point | nullbind(action: import("salamander").Given<Wraith.Input.Action>, fired: Wraith.Keybind.Fired): Wraith.Keybindgamepad(): Wraith.Input.GamepadAxes | nullkeyDown(key: Wraith.Key|Wraith.KeyName): booleanbuttonDown(button: Wraith.MouseButton|Wraith.MouseButtonName): booleanmousePos(): Wraith.Point|nilbind(action: Wraith.Input.Action, fired: Wraith.Keybind.Fired): Wraith.Keybindgamepad(): Wraith.Input.GamepadAxes|nilbool KeyDown(Wraith.Key key)bool ButtonDown(Wraith.MouseButton button)Wraith.Point? MousePos()Wraith.Keybind? Bind(Wraith.Input.Action action, Wraith.Keybind.Fired? fired)Wraith.Input.GamepadAxes? Gamepad()bool keyDown(Wraith::Key key) constbool buttonDown(Wraith::MouseButton button) conststd::optional<Wraith::Point> mousePos() constsal::Result<Wraith::Keybind, Wraith::KeybindError> bind(Wraith::Input_Action action, Wraith::Keybind_Fired fired) conststd::optional<Wraith::Input_GamepadAxes> gamepad() constpub fn key_down(&self, key: wraith::Key) -> boolpub fn button_down(&self, button: wraith::MouseButton) -> boolpub fn mouse_pos(&self) -> Option<wraith::Point>pub fn bind(&self, action: wraith::InputAction, fired: wraith::KeybindFired) -> Result<wraith::Keybind, wraith::KeybindError>pub fn gamepad(&self) -> Option<wraith::InputGamepadAxes>fn keyDown(self: Wraith.Input, key: Wraith.Key) boolfn buttonDown(self: Wraith.Input, button: Wraith.MouseButton) boolfn mousePos(self: Wraith.Input) ?Wraith.Pointfn bind(self: Wraith.Input, action: Wraith.Input.Action, fired: Wraith.Keybind.Fired) (Wraith.KeybindError || rt.Failure)!Wraith.Keybindfn gamepad(self: Wraith.Input) ?Wraith.Input.GamepadAxesbool Wraith_Input_keyDown(Wraith_Input self, Wraith_Key key)bool Wraith_Input_buttonDown(Wraith_Input self, Wraith_MouseButton button)Opt_Wraith_Point Wraith_Input_mousePos(Wraith_Input self)uint32_t Wraith_Input_bind(Wraith_Input self, Wraith_Input_Action action, Wraith_Keybind_Fired fired, Wraith_Keybind *out)Opt_Wraith_Input_GamepadAxes Wraith_Input_gamepad(Wraith_Input self)keyDown
Section titled “keyDown”Held now. Losing focus releases everything. Any thread.
Uses Key.
buttonDown
Section titled “buttonDown”Uses MouseButton.
mousePos
Section titled “mousePos”Null if it doesn’t know yet. Any thread.
Uses Point.
A key setting listed under the plugin in Settings. Gone with the plugin.
Fails with KeybindError. Uses Input.Action, Keybind.Fired, Keybind.
gamepad
Section titled “gamepad”Null without a controller. Any thread.
Uses Input.GamepadAxes.
Physical keys, named for the US layout. gamepad_a is the bottom face button on any controller.
An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | tab |
|
| 1 | left |
|
| 2 | right |
|
| 3 | up |
|
| 4 | down |
|
| 5 | page_up |
|
| 6 | page_down |
|
| 7 | home |
|
| 8 | end |
|
| 9 | insert |
|
| 10 | delete |
|
| 11 | backspace |
|
| 12 | space |
|
| 13 | enter |
|
| 14 | escape |
|
| 15 | left_ctrl |
|
| 16 | left_shift |
|
| 17 | left_alt |
|
| 18 | left_super |
|
| 19 | right_ctrl |
|
| 20 | right_shift |
|
| 21 | right_alt |
|
| 22 | right_super |
|
| 23 | menu |
|
| 24 | digit_0 |
|
| 25 | digit_1 |
|
| 26 | digit_2 |
|
| 27 | digit_3 |
|
| 28 | digit_4 |
|
| 29 | digit_5 |
|
| 30 | digit_6 |
|
| 31 | digit_7 |
|
| 32 | digit_8 |
|
| 33 | digit_9 |
|
| 34 | a |
|
| 35 | b |
|
| 36 | c |
|
| 37 | d |
|
| 38 | e |
|
| 39 | f |
|
| 40 | g |
|
| 41 | h |
|
| 42 | i |
|
| 43 | j |
|
| 44 | k |
|
| 45 | l |
|
| 46 | m |
|
| 47 | n |
|
| 48 | o |
|
| 49 | p |
|
| 50 | q |
|
| 51 | r |
|
| 52 | s |
|
| 53 | t |
|
| 54 | u |
|
| 55 | v |
|
| 56 | w |
|
| 57 | x |
|
| 58 | y |
|
| 59 | z |
|
| 60 | f1 |
|
| 61 | f2 |
|
| 62 | f3 |
|
| 63 | f4 |
|
| 64 | f5 |
|
| 65 | f6 |
|
| 66 | f7 |
|
| 67 | f8 |
|
| 68 | f9 |
|
| 69 | f10 |
|
| 70 | f11 |
|
| 71 | f12 |
|
| 72 | f13 |
|
| 73 | f14 |
|
| 74 | f15 |
|
| 75 | f16 |
|
| 76 | f17 |
|
| 77 | f18 |
|
| 78 | f19 |
|
| 79 | f20 |
|
| 80 | f21 |
|
| 81 | f22 |
|
| 82 | f23 |
|
| 83 | f24 |
|
| 84 | apostrophe |
|
| 85 | comma |
|
| 86 | minus |
|
| 87 | period |
|
| 88 | slash |
|
| 89 | semicolon |
|
| 90 | equal |
|
| 91 | left_bracket |
|
| 92 | backslash |
|
| 93 | right_bracket |
|
| 94 | grave |
|
| 95 | caps_lock |
|
| 96 | scroll_lock |
|
| 97 | num_lock |
|
| 98 | print_screen |
|
| 99 | pause |
|
| 100 | keypad_0 |
|
| 101 | keypad_1 |
|
| 102 | keypad_2 |
|
| 103 | keypad_3 |
|
| 104 | keypad_4 |
|
| 105 | keypad_5 |
|
| 106 | keypad_6 |
|
| 107 | keypad_7 |
|
| 108 | keypad_8 |
|
| 109 | keypad_9 |
|
| 110 | keypad_decimal |
|
| 111 | keypad_divide |
|
| 112 | keypad_multiply |
|
| 113 | keypad_subtract |
|
| 114 | keypad_add |
|
| 115 | keypad_enter |
|
| 116 | browser_back |
|
| 117 | browser_forward |
|
| 118 | oem_102 |
|
| 119 | gamepad_a |
|
| 120 | gamepad_b |
|
| 121 | gamepad_x |
|
| 122 | gamepad_y |
|
| 123 | gamepad_left_shoulder |
|
| 124 | gamepad_right_shoulder |
|
| 125 | gamepad_left_trigger |
|
| 126 | gamepad_right_trigger |
|
| 127 | gamepad_dpad_up |
|
| 128 | gamepad_dpad_down |
|
| 129 | gamepad_dpad_left |
|
| 130 | gamepad_dpad_right |
|
| 131 | gamepad_start |
|
| 132 | gamepad_back |
|
| 133 | gamepad_left_stick |
|
| 134 | gamepad_right_stick |
MouseButton
Section titled “MouseButton”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | left |
|
| 1 | right |
|
| 2 | middle |
|
| 3 | x1 |
|
| 4 | x2 |
Either side.
Bits of a u8.
| Bits | Member | Type | |
|---|---|---|---|
| 0 | ctrl |
bool |
|
| 1 | shift |
bool |
|
| 2 | alt |
bool |
|
| 3 | super |
bool |
A non-modifier key with exactly these modifiers. Controller buttons take none.
A struct, 0x2 bytes, aligned to 1.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | key |
Key |
|
| 0x1 | mods |
Mods |
key: Wraith.Key | Wraith.KeyNamemods: numberkey: Wraith.Key|Wraith.KeyNamemods: integerWraith.Key KeyWraith.Mods ModsWraith::Key keyWraith::Mods modspub key: wraith::Keypub mods: wraith::Modskey: Wraith.Keymods: Wraith.ModsWraith_Key keyWraith_Mods modsIn the game window’s client coords.
A struct, 0x8 bytes, aligned to 4.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | x |
i32 |
|
| 0x4 | y |
i32 |
x: numbery: numberx: integery: integerint Xint Yint32_t xint32_t ypub x: i32pub y: i32x: i32y: i32int32_t xint32_t yKeybindError
Section titled “KeybindError”What can go wrong, besides Cancelled, Unsupported and Gone.
| Code | Error | |
|---|---|---|
| 1 | Unavailable |
|
| 2 | AlreadyBound |
|
| 3 | InvalidChord |
|
| 4 | Failed |
Keybind.Phase
Section titled “Keybind.Phase”An enum of u8.
| Value | Name | |
|---|---|---|
| 0 | pressed |
|
| 1 | released |
Keybind.Fired
Section titled “Keybind.Fired”On the render thread.
Wraith.Keybind.FiredWraith.Keybind.FiredWraith.Keybind.FiredWraith::Keybind_Firedwraith::KeybindFiredWraith.Keybind.FiredWraith_Keybind_FiredInput.Action
Section titled “Input.Action”A struct, 0x40 bytes, aligned to 8.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | id |
string |
Unique for the plugin. Letters, digits, _, - and .. |
| 0x10 | name |
string |
What Settings lists it as |
| 0x20 | chord |
Chord |
The default. The player’s picks in Settings win. |
| 0x28 | also |
[]Chord |
Up to 3 more defaults, like a controller button |
| 0x38 | passthrough |
bool |
The game sees the key too |
| 0x39 | while_typing |
bool |
Still fires while typing in a text box |
| 0x3a | scope |
Setting.Scope |
Where the player’s pick is kept |
| 0x3b | held |
bool |
Held, like a move key: fires whatever modifiers are down, and can be a modifier itself. No chord modifiers. |
id: stringname: stringchord: Wraith.Chordalso: Array<Wraith.Chord>passthrough: booleanwhile_typing: booleanscope: Wraith.Setting.Scope | Wraith.Setting.ScopeNameheld: booleanid: stringname: stringchord: Wraith.Chordalso: (Wraith.Chord)[]passthrough: booleanwhile_typing: booleanscope: Wraith.Setting.Scope|Wraith.Setting.ScopeNameheld: booleanstring Idstring NameWraith.Chord ChordWraith.Chord[] Alsobool Passthroughbool WhileTypingWraith.Setting.Scope Scopebool Heldsal::String idsal::String nameWraith::Chord chordsal::Slice<Wraith::Chord> alsobool passthroughbool while_typingWraith::Setting_Scope scopebool heldpub id: salamander::Strpub name: salamander::Strpub chord: wraith::Chordpub also: salamander::Slice<wraith::Chord>pub passthrough: boolpub while_typing: boolpub scope: wraith::SettingScopepub held: boolid: []const u8name: []const u8chord: Wraith.Chordalso: []const Wraith.Chordpassthrough: boolwhile_typing: boolscope: Wraith.Setting.Scopeheld: boolsal_string idsal_string nameWraith_Chord chordSlice_Wraith_Chord alsobool passthroughbool while_typingWraith_Setting_Scope scopebool heldInput.GamepadAxes
Section titled “Input.GamepadAxes”Sticks -1 to 1 with up and right positive, triggers 0 to 1, no dead zone. All controllers merged.
A struct, 0x18 bytes, aligned to 4.
| Offset | Field | Type | |
|---|---|---|---|
| 0x0 | left_x |
f32 |
|
| 0x4 | left_y |
f32 |
|
| 0x8 | right_x |
f32 |
|
| 0xc | right_y |
f32 |
|
| 0x10 | left_trigger |
f32 |
|
| 0x14 | right_trigger |
f32 |
left_x: numberleft_y: numberright_x: numberright_y: numberleft_trigger: numberright_trigger: numberleft_x: numberleft_y: numberright_x: numberright_y: numberleft_trigger: numberright_trigger: numberfloat LeftXfloat LeftYfloat RightXfloat RightYfloat LeftTriggerfloat RightTriggerfloat left_xfloat left_yfloat right_xfloat right_yfloat left_triggerfloat right_triggerpub left_x: f32pub left_y: f32pub right_x: f32pub right_y: f32pub left_trigger: f32pub right_trigger: f32left_x: f32left_y: f32right_x: f32right_y: f32left_trigger: f32right_trigger: f32float left_xfloat left_yfloat right_xfloat right_yfloat left_triggerfloat right_triggerwraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
