Skip to content

Match a keyboard shortcut ​

Parse Ctrl+Shift+K once, then match it on key_down. Poll with isPressed if you need a hold.

lua
local Keys = require("sdk.keys")
local combo, err = Keys.parse("Ctrl+Shift+K")
if not combo then
  print("Invalid shortcut", err)
  return
end

game.on("key_down", function(vk, mods)
  if Keys.matches(vk, mods, combo) then
    print("Ctrl+Shift+K")
  end
end)

if Keys.isPressed(combo) then
  print("held")
end

Arcane SDK catalog generated from scripts/sdk