Skip to content

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:

lua
press_ability(slot.ability1)      -- taps whatever key ability 1 is bound to

it 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_melee returns the parry key, not the melee key. slot_to_key cannot reach the melee bind, and the keybinds table has no melee accessor. Use input.melee() to press it, or input.bind("melee") to read it.
  • slot.slide returns the dash key. slot_to_key(slot.slide) is the same key as keybinds.dash_key().
  • slot_to_key returns 0, never nil, for every slot outside ability1 to ability4, item1 to item4, jump, slide and weapon_melee. press_ability silently 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) or 0x0F (wheel down). No script function can press it, input.parry() included, even though the call returns true. Parry is often on wheel down, so check input.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 for duration milliseconds, then releases it. The default is 500 ms. Use it for charged abilities like Abrams' charge, where you commit and then release. Your on_tick pauses at this call until the key is released. It only works inside on_tick or a coroutine of your own, and raises an error in other callbacks.
  • slot_to_key(slot). Returns the VK code bound to a slot (ability1 to ability4, item1 to item4, jump, slide or weapon_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 as slot_to_key(config_slot + 4). The result is a key code for input.press_key(). It is not a slot number, so do not pass it back into player:get_ability() or player:is_item_ready().

There are twelve read-only accessors:

  • keybinds.ability1_key() through keybinds.item4_key(). Each returns the configured VK code for one slot, the same as slot_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.

lua
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 nil

These 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.