class

Egui::InputState

Inherits Reference < Object

Constructors

build(raw : RawInput, prev : InputState | Nil, prev_time : Float64 | Nil) : InputState

Derive this frame's input from RawInput carried over the previous frame's InputState (upstream PointerState persistence): pointer position and button state survive frames without move/press events. Without this, hover/active flicker on eventless frames.

Source
new(screen_rect : Rect, pointer_pos : Pos2 | Nil, pointer_down : Bool, pointer_pressed : Bool, pointer_released : Bool, scroll : Vec2, time : Float64, dt : Float64, pointer_delta : Vec2 = Vec2.zero, pointer_velocity : Vec2 = Vec2.zero, keys_down : Set(KeyCode) = Set(KeyCode).new, keys_pressed : Set(KeyCode) = Set(KeyCode).new, keys_released : Set(KeyCode) = Set(KeyCode).new, text : String = "", modifiers : Modifiers = Modifiers.new, secondary_pressed : Bool = false, secondary_pos : Pos2 | Nil = nil, secondary_down : Bool = false, secondary_released : Bool = false, dropped_files : Array(String) = [] of String)
Source

Instance methods

aim_radius

egui InputState::aim_radius — how coarse the pointer aims (in points); sliders pass ± this around the pointer position to smart_aim. Upstream uses the physical pixel size; we use 2 points.

Source
any_modifier_down?
Source
consume_key(key : KeyCode) : Bool

egui InputState::consume_key: a widget claims a pressed key; subsequent widgets (and navigation) no longer see it.

Source
consumed_keys
Source
dropped_files

Files dropped onto the window this frame (empty on every other).

Source
key_down?(key : KeyCode) : Bool
Source
key_pressed?(key : KeyCode) : Bool
Source
key_released?(key : KeyCode) : Bool
Source
keys_down

Keyboard: currently-held keys, this frame's press/release sets, keys already eaten by a widget (consume_key), concatenated text input, and the last-seen modifier state (egui InputState).

Source
keys_pressed
Source
keys_released
Source
modifiers
Source
pointer_delta
Source
pointer_down?
Source
pointer_pos
Source
pointer_pressed?
Source
pointer_released?
Source
pointer_velocity
Source
screen_rect
Source
scroll
Source
secondary_down?

Secondary (right) button held state — the Paint-canvas idiom of drawing with the background color needs drag + release, not just the press event (which is all #secondary_pressed? carries).

Source
secondary_pos
Source
secondary_pressed?

Secondary (right) button: a press this frame and where it landed — enough to open context menus on press without plumbing the full per-button pointer state.

Source
secondary_released?
Source
shortcut_modifiers_down?

Text-input filter (upstream filters_out_shortcuts): only real shortcut modifiers — Ctrl / Cmd — drop typed characters. Shift is how capitals are typed and must pass through (Shift held while the letter arrives must NOT eat it), and Ctrl+Alt together is Windows' AltGr, which also produces real characters.

Source
text
Source
time
Source