Skip to content

input

The input namespace. Nyx Lua API v1.

input.key_down(key: string | number) -> boolean

Held now. Nyx polls a key from the first time the script reads it until the script unloads, so the first read of a key nothing polled yet is false. False while the player types into the game's chat or console, or Nyx's chat.

input.key_pressed(key: string | number) -> boolean

Went down this frame. Nyx polls a key from the first time the script reads it until the script unloads, so the first read of a key nothing polled yet may miss a press that frame. False while the player types into the game's chat or console, or Nyx's chat.

input.mouse_pos() -> vector

Cursor position.

input.wheel() -> number

Wheel movement this frame.