Trait piston_window::TextEvent[]

pub trait TextEvent {
    pub fn from_text(text: &str, old_event: &Self) -> Option<Self>;
pub fn text<U, F>(&self, f: F) -> Option<U>
    where
        F: FnMut(&str) -> U
; pub fn text_args(&self) -> Option<String> { ... } }

When receiving text from user, such as typing a character.

Required methods

pub fn from_text(text: &str, old_event: &Self) -> Option<Self>

Creates a text event.

Preserves time stamp from original input event, if any.

pub fn text<U, F>(&self, f: F) -> Option<U> where
    F: FnMut(&str) -> U, 

Calls closure if this is a text event.

Loading content...

Provided methods

pub fn text_args(&self) -> Option<String>

Returns text arguments.

Loading content...

Implementors

impl TextEvent for Event

Loading content...