mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
android: use show_soft_input to summon the keyboard
Route it via the `Window::set_ime_allowed` like on iOS.
This commit is contained in:
committed by
Kirill Chibisov
parent
bab2d82fd3
commit
1d18a6ca57
@@ -46,6 +46,7 @@ changelog entry.
|
||||
to fully disable the menu bar and dock in Borderless Fullscreen as commonly done in games.
|
||||
- On X11, the `window` example now understands the `X11_VISUAL_ID` and `X11_SCREEN_ID` env
|
||||
variables to test the respective modifiers of window creation.
|
||||
- On Android, the soft keyboard can now be shown using `Window::set_ime_allowed`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -908,7 +908,13 @@ impl Window {
|
||||
|
||||
pub fn set_ime_cursor_area(&self, _position: Position, _size: Size) {}
|
||||
|
||||
pub fn set_ime_allowed(&self, _allowed: bool) {}
|
||||
pub fn set_ime_allowed(&self, allowed: bool) {
|
||||
if allowed {
|
||||
self.app.show_soft_input(true);
|
||||
} else {
|
||||
self.app.hide_soft_input(true);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_ime_purpose(&self, _purpose: ImePurpose) {}
|
||||
|
||||
|
||||
@@ -1274,7 +1274,8 @@ impl Window {
|
||||
///
|
||||
/// - **macOS:** IME must be enabled to receive text-input where dead-key sequences are
|
||||
/// combined.
|
||||
/// - **iOS / Android / Web / Orbital:** Unsupported.
|
||||
/// - **iOS / Android:** This will show / hide the soft keyboard.
|
||||
/// - **Web / Orbital:** Unsupported.
|
||||
/// - **X11**: Enabling IME will disable dead keys reporting during compose.
|
||||
///
|
||||
/// [`Ime`]: crate::event::WindowEvent::Ime
|
||||
|
||||
Reference in New Issue
Block a user