You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! We're trying to use Esc as a shortcut (via ctx.input()) to exit a screen that has a TextEdit on it (this is on a "Settings" screen and Esc returns the user to the main app). We're using wants_keyboard_input() to ignore shortcut keys while editing is underway.
However, when the user is editing a TextBox's text and presses Esc to cancel editing, egui acts on it, and ctx.wants_keyboard_input() has already become false by the time we can call ctx.input(), so Esc double-acts by (a) cancelling focus and (b) exiting the screen.
Is there a way to filter (in ctx.input(), say) or hook only events that were not handled by egui (perhaps after rendering the widgets so a widget could flag events as having been acted on)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! We're trying to use
Esc
as a shortcut (viactx.input()
) to exit a screen that has aTextEdit
on it (this is on a "Settings" screen andEsc
returns the user to the main app). We're usingwants_keyboard_input()
to ignore shortcut keys while editing is underway.However, when the user is editing a
TextBox
's text and pressesEsc
to cancel editing, egui acts on it, andctx.wants_keyboard_input()
has already becomefalse
by the time we can callctx.input()
, soEsc
double-acts by (a) cancelling focus and (b) exiting the screen.Is there a way to filter (in
ctx.input()
, say) or hook only events that were not handled by egui (perhaps after rendering the widgets so a widget could flag events as having been acted on)?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions