input.IsButtonDown(key:number):booleanWhether a button is held down.
Buttons, key presses, mouse state.
input.IsButtonDown(key:number):booleanWhether a button is held down.
input.IsKeyPressed(key:number):booleanWhether a key was pressed this tick.
input.IsKeyReleased(key:number):booleanWhether a key was released this tick.
input.GetMousePosition():number,numberCurrent mouse cursor position.
input.GetKeyName(key:number):stringDisplay name for a Windows VK code.
input.GetMousePos():number,numberAlias of GetMousePosition.
input.IsButtonPressed(button:number):boolean,numberPressed state and the tick it was pressed.
input.IsButtonReleased(button:number):boolean,numberReleased state and the tick it was released.
input.IsMouseInputEnabled():booleanWhether mouse input is enabled for Lua.
input.SetMouseInputEnabled(enabled:boolean)Enable or disable mouse input.
input.GetPollTick():numberEngine tick of the current frame.
Tap F8 to switch your FOV between 90 and 120, with a toast.
local wide = false
callbacks.Register("CreateMove", function()
if input.IsButtonPressed(KEY_F8) then
wide = not wide
client.SetConVar("fov_desired", wide and 120 or 90)
engine.Notification("FOV", wide and "120" or "90")
end
end)