Keybinds and input
Keybinds
Section titled “Keybinds”wraith.keybinds.bind("heal", { name = "Heal", chord = "ctrl+h" }, function() ... end)Players can rebind them in the overlay. The id is what their choice is saved under, so keep it stable.
A controller button works too, like "gamepad_back" or "gamepad_y", without Ctrl, Shift or Alt. The buttons are named after an Xbox pad: gamepad_a, gamepad_b, gamepad_x, gamepad_y, gamepad_left_shoulder, gamepad_right_shoulder, gamepad_left_trigger, gamepad_right_trigger, gamepad_dpad_up and so on, gamepad_start, gamepad_back, gamepad_left_stick and gamepad_right_stick.
Keys and the mouse
Section titled “Keys and the mouse”input.isDown takes a key named like in a chord, so "f8", "a", "left_shift", "gamepad_a" or "ctrl" for either side, or a mouse button like "mouse_left". input.mousePos() is { x, y } in the game window.
local input = wraith.input
if input.isDown("shift") and input.isDown("mouse_right") then aim(input.mousePos()) endKeys and the mouse go by the game window’s messages, so nothing’s down while another window has focus. Controllers are read on their own and don’t need focus.
Taking input from the game
Section titled “Taking input from the game”overlay.takeInput hides the keyboard, the mouse or controllers from the game, until you give it back or the plugin stops. A taken keyboard or controller also moves around the overlay’s windows. overlay.showCursor only draws the cursor, so take the mouse too if clicks shouldn’t reach the game.
local overlay = wraith.overlay
overlay.takeInput("mouse", true)overlay.showCursor(true)-- ...overlay.takeInput("mouse", false)overlay.showCursor(false)overlay.inputTaken("keyboard") says whether anyone has it, like the user being in the overlay. Players can stop controllers being taken at all in Wraith’s settings.
Made with ♥ by Asgard
