[][src]Trait enigo::KeyboardControllable

pub trait KeyboardControllable {
    fn key_sequence(&mut self, sequence: &str);
fn key_down(&mut self, key: Key);
fn key_up(&mut self, key: Key);
fn key_click(&mut self, key: Key); fn key_sequence_parse(&mut self, sequence: &str)
    where
        Self: Sized
, { ... }
fn key_sequence_parse_try(
        &mut self,
        sequence: &str
    ) -> Result<(), ParseError>
    where
        Self: Sized
, { ... } }

Representing an interface and a set of keyboard functions every operating system implementation should implement.

Required methods

fn key_sequence(&mut self, sequence: &str)

Types the string

Emits keystrokes such that the given string is inputted.

You can use many unicode here like: ❤️. This works regadless of the current keyboardlayout.

Example

use enigo::*;
let mut enigo = Enigo::new();
enigo.key_sequence("hello world ❤️");

fn key_down(&mut self, key: Key)

presses a given key down

fn key_up(&mut self, key: Key)

release a given key formally pressed down by key_down

fn key_click(&mut self, key: Key)

Much like the key_down and key_up function they're just invoked consecutively

Loading content...

Provided methods

fn key_sequence_parse(&mut self, sequence: &str) where
    Self: Sized

Types the string parsed with DSL.

Typing {+SHIFT}hello{-SHIFT} becomes HELLO. TODO: Full documentation

fn key_sequence_parse_try(&mut self, sequence: &str) -> Result<(), ParseError> where
    Self: Sized

Same as key_sequence_parse except returns any errors

Loading content...

Implementors

impl KeyboardControllable for Enigo[src]

fn key_sequence_parse(&mut self, sequence: &str) where
    Self: Sized
[src]

fn key_sequence_parse_try(&mut self, sequence: &str) -> Result<(), ParseError> where
    Self: Sized
[src]

Loading content...