Trait winput::Keylike [−][src]
pub trait Keylike: Copy { fn produce_input(self, action: Action) -> Input; }
Expand description
Required methods
fn produce_input(self, action: Action) -> Input
fn produce_input(self, action: Action) -> Input
Produces an Input
that causes the given action to be taken on self
.
Panics
This function panics if self
was not a valid key. For example, any char
that
is above 0x0000ffff
cannot be turned into an Input
.
Example
ⓘ
use winput::{Keylike, Action}; let input = 'A'.produce_input(Action::Press); winput::send_inputs(&[input]);