skynet/cclib/keys.lua

136 lines
2.5 KiB
Lua

---@meta
---@type integer
local int
---It is recommended that you use the constant values defined here rather than
---any numerical values as they may change between versions
---
------
---[Official Documentation](https://tweaked.cc/module/keys.html)
keys = {
["space"] = int,
["apostrophe"] = int,
["comma"] = int,
["minus"] = int,
["period"] = int,
["slash"] = int,
["zero"] = int,
["one"] = int,
["two"] = int,
["three"] = int,
["four"] = int,
["five"] = int,
["six"] = int,
["seven"] = int,
["eight"] = int,
["nine"] = int,
["semicolon"] = int,
["equals"] = int,
["a"] = int,
["b"] = int,
["c"] = int,
["d"] = int,
["e"] = int,
["f"] = int,
["g"] = int,
["h"] = int,
["i"] = int,
["j"] = int,
["k"] = int,
["l"] = int,
["m"] = int,
["n"] = int,
["o"] = int,
["p"] = int,
["q"] = int,
["r"] = int,
["s"] = int,
["t"] = int,
["u"] = int,
["v"] = int,
["w"] = int,
["x"] = int,
["y"] = int,
["z"] = int,
["leftBracket"] = int,
["backslash"] = int,
["rightBracket"] = int,
["grave"] = int,
["enter"] = int,
["tab"] = int,
["backspace"] = int,
["insert"] = int,
["delete"] = int,
["right"] = int,
["left"] = int,
["down"] = int,
["up"] = int,
["pageUp"] = int,
["pageDown"] = int,
["home"] = int,
["end"] = int,
["capsLock"] = int,
["scrollLock"] = int,
["numLock"] = int,
["printScreen"] = int,
["pause"] = int,
["f1"] = int,
["f2"] = int,
["f3"] = int,
["f4"] = int,
["f5"] = int,
["f6"] = int,
["f7"] = int,
["f8"] = int,
["f9"] = int,
["f10"] = int,
["f11"] = int,
["f12"] = int,
["f13"] = int,
["f14"] = int,
["f15"] = int,
["f16"] = int,
["f17"] = int,
["f18"] = int,
["f19"] = int,
["f20"] = int,
["f21"] = int,
["f22"] = int,
["f23"] = int,
["f24"] = int,
["f25"] = int,
["numPad0"] = int,
["numPad1"] = int,
["numPad2"] = int,
["numPad3"] = int,
["numPad4"] = int,
["numPad5"] = int,
["numPad6"] = int,
["numPad7"] = int,
["numPad8"] = int,
["numPad9"] = int,
["numPadDecimal"] = int,
["numPadDivide"] = int,
["numPadMultiply"] = int,
["numPadSubtract"] = int,
["numPadAdd"] = int,
["numPadEnter"] = int,
["numPadEqual"] = int,
["leftShift"] = int,
["leftCtrl"] = int,
["leftAlt"] = int,
["leftSuper"] = int,
["rightShift"] = int,
["rightCtrl"] = int,
["rightAlt"] = int,
["menu"] = int,
}
---Translates a key code to a written name from the `keys` API
---@param code integer
---@return string|nil name The name of the key or nil if the code was invalid
------
---[Official Documentation](https://tweaked.cc/module/keys.html#v:getName)
function keys.getName(code) end