(ctx: &Context)
| 5 | fn any_widget_focused(ctx: &Context) -> bool { ctx.memory(|mem| mem.focused().is_some()) } |
| 6 | |
| 7 | pub fn enter_pressed(ctx: &Context) -> bool { |
| 8 | if any_widget_focused(ctx) { |
| 9 | return false; |
| 10 | } |
| 11 | ctx.input_mut(|i| { |
| 12 | i.key_pressed(Key::Enter) |
| 13 | || i.key_pressed(Key::Space) |
| 14 | || i.pointer.button_pressed(PointerButton::Extra2) |
| 15 | }) |
| 16 | } |
| 17 | |
| 18 | pub fn back_pressed(ctx: &Context) -> bool { |
| 19 | if any_widget_focused(ctx) { |
no test coverage detected