Game Keybinds
TSUKI reads your Deadlock key settings and fills its own bind values from them. There is nothing to type in.
When a script calls:
press_ability(slot.ability1) -- taps whatever key ability 1 is bound toit presses the key you use for ability 1 in game, even if you rebound it.
When it re-reads
- At startup, right after the config loads.
- Whenever you load, create, import or delete a config.
- When Deadlock saves new key settings. TSUKI checks for this on its own, so a rebind in game is picked up within a few seconds.
- On demand. Open Dev Studio (the bug icon above the menu), go to Advanced, find Game Keybinds and press Update Keybinds. This also drops any game bind you set by hand in the TSUKI menu, so every bind matches Deadlock again.
There is no editor for most binds. A game bind you set by hand in the TSUKI menu, such as the Auto Sinner melee key, is kept until you change that bind in Deadlock.
When a key is unbound
An action with no bind in Deadlock is skipped and TSUKI keeps the value it had.
The primary binding is used. An action bound only on Deadlock's secondary slot uses that secondary key.
If the settings cannot be read, nothing changes.
Gotchas
- Parry is Deadlock's Held Item binding, not melee. Deadlock has no binding called Parry.
slot.weapon_meleereturns the parry key, not the melee key.slot_to_keycannot reach the melee bind, and thekeybindstable has no melee accessor. Useinput.melee()to press it, orinput.bind("melee")to read it.slot.slidereturns the dash key.slot_to_key(slot.slide)is the same key askeybinds.dash_key().slot_to_keyreturns 0, never nil, for every slot outsideability1toability4,item1toitem4,jump,slideandweapon_melee.press_abilitysilently does nothing on a 0.- Per hero binds are not applied. If you rebind an action for one hero only, TSUKI keeps using your global bind for that action.
- Mouse wheel and sided modifiers. A wheel bind comes back as
0x0E(wheel up) or0x0F(wheel down). No script function can press it,input.parry()included, even though the call returnstrue. Parry is often on wheel down, so checkinput.bind("parry")and ask the player to bind parry to a key or mouse button. Shift, Ctrl and Alt come back as the left side code.
Functions
Lua helper functions that press slot keys:
press_ability(slot). Presses and releases the configured key for that slot once, as a quick tap. Use it to cast most abilities or activate instant items.hold_ability(slot, duration). Holds the key down fordurationmilliseconds, then releases it. The default is 500 ms. Use it for charged abilities like Abrams' charge, where you commit and then release. Youron_tickpauses at this call until the key is released. It only works insideon_tickor a coroutine of your own, and raises an error in other callbacks.slot_to_key(slot). Returns the VK code bound to a slot (ability1toability4,item1toitem4,jump,slideorweapon_melee), or 0 for any other slot.item_slot_to_key(0-3). Returns the configured VK code for a 0-based item index (0-3). It is the same asslot_to_key(config_slot + 4). The result is a key code forinput.press_key(). It is not a slot number, so do not pass it back intoplayer:get_ability()orplayer:is_item_ready().
There are twelve read-only accessors:
keybinds.ability1_key()throughkeybinds.item4_key(). Each returns the configured VK code for one slot, the same asslot_to_key(slot.ability1)and so on.keybinds.reload_key(),keybinds.parry_key(),keybinds.dash_key(),keybinds.jump_key(). Return the configured VK code for the reload, parry, dash and jump binds.
All twelve, and slot_to_key, return 0 when nothing is ticking, for example in top-level code when TSUKI first loads your script. Read them inside on_tick or a callback.
slot_to_key and item_slot_to_key have their full entries on Globals, and the slot table is on Types & Constants. Readiness checks like player:is_ability_ready read cooldowns, not binds, so they are on Player.
Press by name instead
input.cast(1..4), input.use_item(1..4), input.melee(), input.parry(), input.tap(name), input.hold(name [, ms]), input.release(name) and input.bind(name) resolve the key by name.
input.cast(1) -- ability 1, by your real bind
input.parry() -- the Held Item bind, whatever it is
local vk = input.bind("melee") -- the key a melee press would use, or nilThese functions re-read your bindings on their own, at most every 2 seconds, so they pick up a rebind without Update Keybinds. They also cover names the accessors do not: attack, attack2, duck, forward, back, moveleft, moveright, use, melee, alt_cast, cancel_ability and zipline.
The full set is on Input.