> For the complete documentation index, see [llms.txt](https://kaizo-1.gitbook.io/kaizo-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaizo-1.gitbook.io/kaizo-docs/lua-engine/game-and-session/input/keys.md).

# keys

## Name

`keys.F1` / `input.keys.F1`

## What it does

Named key macros for `input.is_down`, `input.was_pressed`, `input.was_released`, and the inject helpers.

Same idea as a C `#define`, but built into the Lua VM. You do not need to remember raw Linux KEY numbers.

`keys` and `input.keys` are the same table. Raw numbers still work if you want them.

## Example

```lua
if input.was_pressed(keys.F1) then
    toast.push("F1")
end

if input.is_down(keys.LShift) and input.was_pressed(keys.E) then
    toast.push("shift+E")
end

if input.was_pressed(keys.Backslash) then
    toast.push("toggle")
end

if input.is_down(keys.MouseRight) then
    -- aim key held
end
```

## Letters

`A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`

## Numbers and typing

`Num0` `Num1` `Num2` `Num3` `Num4` `Num5` `Num6` `Num7` `Num8` `Num9`

`Minus` `Equal` `Backspace` `Tab` `Space` `Backslash`

## Function keys

`F1` `F2` `F3` `F4` `F5` `F6` `F7` `F8` `F9` `F10` `F11` `F12`

## Navigation

`Escape` `Insert` `Delete` `Home` `End` `PageUp` `PageDown`

`Up` `Down` `Left` `Right`

## Modifiers

`LCtrl` `RCtrl` `LShift` `RShift` `LAlt` `RAlt` `LSuper` `RSuper`

## Mouse

`MouseLeft` `MouseRight` `MouseMiddle` `MouseSide` `MouseExtra`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kaizo-1.gitbook.io/kaizo-docs/lua-engine/game-and-session/input/keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
