pub(crate) enum Command {
Text {
key_event_duration_msec: u32,
input: String,
},
KeyboardEvent {
duration_msec: u32,
usage: u32,
},
Tap {
width: u32,
height: u32,
tap_event_count: usize,
duration_msec: u32,
x: u32,
y: u32,
},
Swipe {
width: u32,
height: u32,
move_event_count: usize,
duration_msec: u32,
x0: u32,
y0: u32,
x1: u32,
y1: u32,
},
MediaButton {
mic_mute: bool,
volume_up: bool,
volume_down: bool,
reset: bool,
pause: bool,
camera_disable: bool,
},
}
Variants§
Text
Fields
Injects text using QWERTY keystrokes
Text is injected by translating a string into keystrokes using a QWERTY keymap. This facility is intended for end-to-end and input testing purposes only.
Only printable ASCII characters are mapped. Tab, newline, and other control characters are
not supported, and keyevent
should be used instead.
The events simulated consist of a series of keyboard reports, ending in a report with no keys. The number of reports is near the lower bound of reports needed to produce the requested string, minimizing pauses and shift-state transitions.
The --key_event_duration
is the time between each report. Care should be taken not to
provide so long a duration that key repeat kicks in.
Note: when using through fx shell
with quotes, you may need to surround the invocation in
strong quotes, e.g.:
fx shell ‘input text “Hello, world!”’
KeyboardEvent
Tap
Fields
Injects a single tap event
This command simulates a single touch down + up sequence. By default, the x
and y
coordinates are in the range 0 to 1000 and will be proportionally transformed to the
current display, but you can specify a virtual range for the input with the --width
and
--height
options.
The time between the down and up report is --duration
.
Swipe
Fields
Injects a swipe event
This command simulates a touch down, a series of touch move, followed up a touch up event.
By default, the x
and y
coordinates are in the range 0 to 1000 and will be
proportionally transformed to the current display, but you can specify a virtual range for
the input with the --width
and --height
options.
The time between the down and up report is --duration
.
MediaButton
Fields
Injects a MediaButton event
Trait Implementations§
source§impl StructOpt for Command
impl StructOpt for Command
source§fn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
clap::ArgMatches
. It cannot fail
with a parameter generated by clap
by construction.§fn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere Self: Sized,
§fn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making.
Print the error message and quit the program in case of failure.§fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,
Vec
of your making. Read more