Paper does not hook into any platform input API directly — you feed events to it each frame, and it maintains a full frame-aware input state that you can query anywhere in your UI code. All feed methods should be called beforeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Paper/llms.txt
Use this file to discover all available pages before exploring further.
BeginFrame. Query methods can be called at any point between BeginFrame and EndFrame.
Input Feed Methods
Call these from your host application’s event handlers or polling loop, beforepaper.BeginFrame(...).
SetPointerPosition
Horizontal position in logical pixels.
Vertical position in logical pixels.
SetPointerState
isPointerMove is true, only the position is updated and the button state is left unchanged.
The button whose state is being reported.
Current pointer X in logical pixels.
Current pointer Y in logical pixels.
Whether
btn is currently pressed.When
true, the call is treated as a move event and button state is not updated.SetPointerWheel
PointerWheel to 0 at the end of each EndFrame.
Wheel delta in logical scroll units. Positive = scroll down/forward.
AddInputCharacter
\r) are normalised to newlines (\n). The queue is flushed to the focused element during EndFrame and cleared afterward.
The character(s) produced by this key event.
PushInputText
AddInputCharacter for a one-character string.
Character to enqueue.
SetKeyState
LastKeyPressed when isKeyDown is true, and resets auto-repeat counters when isKeyDown is false.
The key whose state changed.
true for key-down; false for key-up.ClearInput
Keyboard Query Methods
IsKeyDown
true while key is held this frame.IsKeyUp
true while key is not held.IsKeyPressed
true only on the first frame the key transitions from up to down.IsKeyReleased
true only on the frame the key transitions from down to up.IsKeyHeld
Minimum seconds the key must have been continuously held.
true if the key has been down for at least holdDuration seconds.IsKeyRepeating
true when KeyAutoRepeatEnabled is true and the key has entered the auto-repeat phase (i.e., held past AutoRepeatDelay and firing at AutoRepeatRate).IsKeyPressedOrRepeating
IsKeyPressed and the auto-repeat check into a single call — the most convenient way to implement text-editor-style held-key behaviour.
true if the key was just pressed this frame or is currently auto-repeating.LastKeyPressed
SetKeyState is called with isKeyDown = true. Not cleared between frames.
Mouse / Pointer Query Methods
IsPointerDown
true while btn is held this frame.IsPointerUp
true while btn is not held.IsPointerPressed
true only on the first frame the button goes down.IsPointerReleased
true only on the frame the button goes up.IsPointerHeld
Minimum seconds the button must have been held.
true when btn has been down for at least holdDuration seconds.IsPointerDoubleClick
true when btn is pressed within 0.25 s of its previous release and the squared distance from the release position is less than 2 (approximately 1.4 logical pixels).
true on the double-click frame.GetPointerClickPos
The pointer position recorded when
btn was last pressed.IsPointerOverRect
Rect left edge in logical pixels.
Rect top edge in logical pixels.
Rect width.
Rect height.
true if the pointer is inside the rectangle.Pointer Position Properties
Current pointer position in logical pixels. Writable — setting this also fires the
OnPointerPosSet event.Pointer position at the end of the previous frame.
PointerPos - PreviousPointerPos. Zero when the pointer has not moved.true when PointerDelta has non-zero length squared.Scroll wheel delta for the current frame. Reset to
0 at the end of each EndFrame.The button most recently updated by
SetPointerState.Keyboard Capture
CaptureKeyboard
WantsCaptureKeyboard to true at the end of the frame. Your host can read WantsCaptureKeyboard after EndFrame to suppress its own key handling.
WantsCaptureKeyboard
true after EndFrame if any element called CaptureKeyboard this frame. Read this in your host to prevent passing keyboard events to game logic while a text field is focused.
Auto-Repeat Configuration
Auto-repeat makes held keys fire repeatedIsKeyPressedOrRepeating pulses, matching system key-repeat behaviour.
Enables or disables key auto-repeat globally. Default
true.Seconds a key must be held before auto-repeat begins. Default
0.8 s. Minimum safe value is 0.1 s.Seconds between repeat pulses once repeating has started. Default
0.05 s (20 repeats/s). Minimum is 0.01 s (100 repeats/s).Clipboard
Paper decouples clipboard access behind an interface to remain platform-agnostic.IClipboardHandler
SetClipboardHandler.
SetClipboardHandler
Your platform clipboard implementation. Must not be
null.GetClipboard
IClipboardHandler.GetClipboardText(). Logs a warning and returns "" if no handler is registered.
Current clipboard text.
SetClipboard
IClipboardHandler.SetClipboardText(text). Logs a warning if no handler is registered.
Text to place on the system clipboard.
Cursor Visibility
SetCursorVisibility
OnCursorVisibilitySet event with visible. Hook this event in your host to show or hide the OS cursor.
true to show the cursor; false to hide it.Events
Fired whenever
PointerPos is set (via the property setter). Passes the new position.Fired whenever
SetCursorVisibility is called. Passes the requested visibility.PaperKey Enum
All keyboard keys supported by Paper. Pass values from this enum toSetKeyState and all IsKey* query methods.
| Group | Values |
|---|---|
| Alpha | A–Z |
| Digits | Num0–Num9 |
| Function | F1–F12 |
| Control | Enter, Escape, Backspace, Tab, Space |
| Punctuation | Minus, Equals, LeftBracket, RightBracket, Backslash, Semicolon, Apostrophe, Grave, Comma, Period, Slash |
| System | CapsLock, PrintScreen, ScrollLock, Pause, Insert, Home, PageUp, Delete, End, PageDown |
| Arrows | Right, Left, Down, Up |
| Numpad | NumLock, KeypadDivide, KeypadMultiply, KeypadMinus, KeypadPlus, KeypadEnter, KeypadEquals, Keypad0–Keypad9, KeypadDecimal |
| Modifiers | LeftControl, LeftShift, LeftAlt, LeftSuper, RightControl, RightShift, RightAlt, RightSuper |
| Media | AudioNext, AudioPrevious, AudioStop, AudioPlay, AudioMute |
| Application | Application, Menu, Select, Help |
| Sentinel | Unknown = 0 |
PaperMouseBtn Enum
| Value | Meaning |
|---|---|
Unknown | Sentinel / unset |
Left | Primary / left button |
Middle | Middle / scroll-wheel button |
Right | Secondary / right button |
Button4–Button8 | Extra buttons on extended mice |