reskate.input gives your plugin actions the player can press, and reads the keyboard, mouse, gamepad and joystick for a plugin that flies something. Every function, and the action event, needs the input permission; calling one without it raises an error. See permissions.
Actions
reskate.input.bind(action, key)
Puts a named action on a key or a pad combo. Each press fires the action event with the action’s name, once, while the game itself has the input: not while a menu, the console or a text box is open.
The player sees your actions on the Binds page of ReSkate’s settings and can record another combo for any of them, or clear it. The player’s choice wins over yours and is kept between sessions.
string
required
The action’s name, 1 to 48 characters. It is what the
action event hands your handler. Binding a name again replaces its combo.string
required
A key, a key combo, or a pad combo, at most 60 characters (see below).
boolean
True when the action is bound.
string
"that is not a key or pad combo" when ok is false.Needs the
input permission. A plugin has at most 16 actions. When the plugin stops, its actions go away (the player’s choices for them are kept).Key and pad combo names
A combo is names joined with+, with no spaces. Case does not matter. A combo is either keys or pad buttons, never both.
Keys (up to 5 held together):
Examples:
"F7", "Ctrl+K", "Shift+Alt+1", "Space".
Pad buttons, each written Pad. and the button:
Examples:
"Pad.A", "Pad.LB+Pad.RB", "Pad.Up+Pad.Y".
The action event
input permission. See events.
Flight input
reskate.input.flight()
The flight keys and the mouse, as Freecam reads them, for a plugin that flies its own camera. It answers only while the plugin’s camera view is the one shown, the game window has the focus, and no ReSkate menu is open.
table or nil
nil when the plugin’s view is not shown, or the game cannot be read now.Needs the
input permission and a camera view of the plugin’s own (camera.look or camera.set).Controllers
reskate.input.gamepad()
The gamepad’s sticks, triggers and buttons. It reads the pad even while the game is kept from it (see capture).
table or nil
nil when no pad is connected or the game window does not have the focus.Needs the
input permission.reskate.input.joystick()
A joystick or RC radio connected to Windows. When there are several, one whose name holds “radio” is chosen first, otherwise the first one found.
table or nil
nil when none is connected or the game window does not have the focus.Needs the
input permission.reskate.input.capture(on)
Keeps the game from reading the controller, so the player can fly your camera with the pad without the skater moving too. Each call keeps it for 250 ms: call it every tick for as long as you want it. Your plugin still reads the pad with gamepad().
boolean
required
True to keep the controller for the next 250 ms, false (or nothing) to give it back now.
boolean
True when the controller is kept (or given back).
string
"only while the plugin's camera is shown" when ok is false.Needs the
input permission. It works only while the plugin’s own camera view is shown: when Spectate takes the camera, or the plugin releases it, the game has the controller again at once. One plugin captures at a time: the latest call wins.reskate.input.hide(controls)
Keeps some of the pad’s controls from the game, for a plugin that gives them a job of its own, such as picking a grind’s exit with the triggers. A hidden trigger reads to the game as let go. The left stick’s left and right, hidden while grinding, read as centred only while the skater grinds, so a push held through the pop reaches the game at the pop. Your plugin still reads them all with gamepad().
table or nil
required
What to keep from the game. Each call replaces your plugin’s last one;
nil or {} gives everything back.boolean
True when the controls are hidden (or given back).
string
"hiding pad controls is unavailable for this game build" when ok is false.Needs the
input permission. Unlike capture, it needs no camera of your own and lasts until you change it. A control stays hidden while any plugin hides it. Your plugin reads the pad once a tick, so the game may see a trigger for a frame before you hide it. When the plugin stops, everything it hid is given back.