Skip to content

Commit 3bcb928

Browse files
macnellynot-fl3
authored andcommitted
show/hide android virtual keyboard on input focus/blur
1 parent 5c5e8f4 commit 3bcb928

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ui/widgets/editbox.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
math::{vec2, Rect, Vec2},
3-
ui::{ElementState, Id, InputCharacter, Key, KeyCode, Layout, Ui},
3+
ui::{ElementState, Id, InputCharacter, Key, KeyCode, Layout, Ui}, get_quad_context,
44
};
55

66
pub struct Editbox<'a> {
@@ -262,9 +262,13 @@ impl<'a> Editbox<'a> {
262262
let hovered = rect.contains(context.input.mouse_position);
263263

264264
if context.input.click_down() && hovered {
265+
#[cfg(target_os = "android")]
266+
get_quad_context().show_keyboard(true);
265267
*context.input_focus = Some(self.id);
266268
}
267269
if context.input_focused(self.id) && context.input.click_down() && hovered == false {
270+
#[cfg(target_os = "android")]
271+
get_quad_context().show_keyboard(false);
268272
*context.input_focus = None;
269273
}
270274

0 commit comments

Comments
 (0)