pub struct SystemKeyboard { /* private fields */ }Expand description
The system keyboard as the screens see it: whether there is one, the ask waiting for the platform and the answer waiting for the screen. Absent until the platform says otherwise.
Implementations§
Source§impl SystemKeyboard
impl SystemKeyboard
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
Whether the platform has a system keyboard.
Sourcepub fn ask(&mut self, ask: TextAsk) -> bool
pub fn ask(&mut self, ask: TextAsk) -> bool
Asks for the keyboard with ask. Without one nothing is asked and
this is false: the screen takes typed keys instead. Asking again
before the platform opened it replaces the ask; asking while it is
open does nothing, and is false.
Sourcepub fn is_waiting(&self) -> bool
pub fn is_waiting(&self) -> bool
Whether an ask waits for the player: asked for and not yet answered.
Sourcepub fn take_answer(&mut self) -> Option<TextAnswer>
pub fn take_answer(&mut self) -> Option<TextAnswer>
The player’s answer, once: None until they close the keyboard.
Sourcepub fn set_present(&mut self, present: bool)
pub fn set_present(&mut self, present: bool)
The platform says whether it has a keyboard, before each frame. One
that goes away takes an ask with it: the screen hears
TextAnswer::Cancelled.
Sourcepub fn take_ask(&mut self) -> Option<TextAsk>
pub fn take_ask(&mut self) -> Option<TextAsk>
The ask to open, once, for the platform: from then on the keyboard
is open until answer.
Sourcepub fn answer(&mut self, answer: TextAnswer)
pub fn answer(&mut self, answer: TextAnswer)
The platform hands back what the player did, which closes the keyboard.
Trait Implementations§
Source§impl Clone for SystemKeyboard
impl Clone for SystemKeyboard
Source§fn clone(&self) -> SystemKeyboard
fn clone(&self) -> SystemKeyboard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more