Prowl’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
Input class is the single, stateless gateway to every keyboard key, mouse button, and cursor property during a frame. It exposes a simple polling API — call GetKey, GetMouseButton, and their variants anywhere in a MonoBehaviour callback and receive an instant boolean answer. Under the hood, Input is backed by a stack of IInputHandler objects so that UI layers, cutscene managers, and menus can each push their own handler on top, suppressing game input without touching your gameplay code.
Quick Reference
| Member | Type | Description |
|---|---|---|
GetKey(Key) | bool | true while the key is held down |
GetKeyDown(Key) | bool | true only on the frame the key was pressed |
GetKeyUp(Key) | bool | true only on the frame the key was released |
GetMouseButton(MouseButton) | bool | true while the button is held |
GetMouseButtonDown(MouseButton) | bool | true on the frame the button was pressed |
GetMouseButtonUp(MouseButton) | bool | true on the frame the button was released |
MousePosition | Vector2Int | Current cursor pixel position |
PrevMousePosition | Vector2Int | Cursor position on the previous frame |
MouseDelta | Vector2 | MousePosition - PrevMousePosition |
MouseWheelDelta | float | Scroll wheel movement this frame |
CursorVisible | bool | Show or hide the OS cursor |
CursorLocked | bool | Lock the cursor to the window center |
Clipboard | string | Read or write the system clipboard |
InputString | IReadOnlyList<char> | Text characters typed this frame |
Keyboard Input
Prowl provides three distinct keyboard queries. Choose the right one to avoid repeated or missed events.Common Key Values
TheKey enum mirrors the Veldrid physical key set. Here are the most commonly used values:
Keyboard keys quick-reference
Keyboard keys quick-reference
Letters —
Key.A through Key.ZTop-row numbers — Key.Num1 through Key.Num9, Key.Num0Modifier keys — Key.LeftShift, Key.RightShift, Key.LeftControl, Key.RightControl, Key.LeftAlt, Key.RightAltNavigation — Key.Up, Key.Down, Key.Left, Key.Right, Key.Home, Key.End, Key.PageUp, Key.PageDownAction keys — Key.Return, Key.Escape, Key.Space, Key.Backspace, Key.Tab, Key.Delete, Key.InsertFunction keys — Key.F1 through Key.F24Numpad — Key.Keypad0 through Key.Keypad9, Key.KeypadPlus, Key.KeypadMinus, Key.KeypadMultiply, Key.KeypadDivide, Key.KeypadEnterMouse Input
Buttons
MouseButton Enum
| Value | Meaning |
|---|---|
MouseButton.Left | Primary button |
MouseButton.Right | Secondary button |
MouseButton.Middle | Scroll-wheel click |
MouseButton.Button1 – MouseButton.Button9 | Extra side buttons |
MouseButton.Unknown | Unrecognised button (-1) |
Position and Delta
MousePosition returns the current cursor position in screen pixels, with (0, 0) at the top-left. MouseDelta is the per-frame movement vector and is the foundation of mouse-look.
Scroll Wheel
Cursor Control
Locking and hiding the cursor is essential for any first-person or twin-stick experience. SetInput.CursorLocked = true to pin the cursor to the window centre and get unbounded MouseDelta movement. Set Input.CursorVisible = false to hide the OS cursor graphic.
The
DefaultInputHandler automatically releases the cursor lock whenever the user presses Escape or the window loses focus, so players can always regain control of their cursor.Text Input
Input.InputString contains every printable character typed during the current frame. Use it for in-game chat boxes or custom text fields.
Clipboard Access
The Handler Stack
Input is not a static singleton with fixed behaviour — it delegates every call to the top-most IInputHandler on Input.Handlers. This makes it trivially easy to layer input contexts:
Implementing IInputHandler
IInputHandler is the contract every handler must fulfill. You can extend DefaultInputHandler for most use cases, or implement the interface from scratch for full control.