[−][src]Struct simulate::EventBuffer
The event buffer is a simple wrapper around a Vec<simulate::Event>
.
Implementations
impl EventBuffer
[src]
pub fn new() -> Self
[src]
Creates a new empty EventBuffer
. (see Vec::new
)
pub fn with_capacity(cap: usize) -> Self
[src]
Creates a new EventBuffer
with the given capacity. (see Vec::with_capacity
)
pub fn add_event(&mut self, event: Event)
[src]
Pushes a new event into the buffer. (see Vec::push
)
pub fn extend(&mut self, events: impl IntoIterator<Item = Event>)
[src]
Inserts multiple events into the buffer. (see Vec::extend
)
pub fn extend_from_slice(&mut self, events: &[Event])
[src]
Extends the buffer from a slice of events. (see Vec::extend_from_slice
)
pub fn append(&mut self, events: &mut EventBuffer)
[src]
Appends the elements of another buffer to this one, living the other
one empty. (see Vec::append
)
pub fn add_multiple<K: Keylike>(&mut self, keys: impl IntoIterator<Item = K>)
[src]
Adds Press
and Release
events for multiple keylikes into the buffer.
pub fn send(&mut self, key: impl Keylike)
[src]
Adds a Press
and a Release
event for the given keylike.
pub fn press(&mut self, key: impl Keylike)
[src]
Adds a Press
event for the given keylike.
pub fn release(&mut self, key: impl Keylike)
[src]
Adds a Release
event for the given keylike.
pub fn type_str(&mut self, s: &str)
[src]
Adds Press
and Release
events for each character of the string.
pub fn move_mouse_relative(&mut self, dx: i32, dy: i32)
[src]
Adds an event that causes the mouse to move dx
pixels to the right
and dy
pixels down.
pub fn move_mouse_absolute(&mut self, x: f32, y: f32)
[src]
Adds an event that causes the mouse to move, coordinates are normalized to the desktop: (0, 0) map to the top-left of the main monitor and (1, 1) maps to the bottom-right of the main monitor.
pub fn add_scroll_event(&mut self, delta: f32, direction: ScrollDirection)
[src]
Adds a scroll event to the buffer.
pub fn scroll(&mut self, delta: f32)
[src]
Uses the mouse wheel vertically.
pub fn scroll_horizontal(&mut self, delta: f32)
[src]
Uses the mouse wheel horizontally.
pub fn simulate(self) -> Result<()>
[src]
Simulates the events using the default simulator.
Trait Implementations
impl AsMut<Vec<Event, Global>> for EventBuffer
[src]
impl AsRef<Vec<Event, Global>> for EventBuffer
[src]
impl Clone for EventBuffer
[src]
pub fn clone(&self) -> EventBuffer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for EventBuffer
[src]
pub fn default() -> EventBuffer
[src]
impl From<EventBuffer> for Vec<Event>
[src]
pub fn from(b: EventBuffer) -> Self
[src]
impl From<Vec<Event, Global>> for EventBuffer
[src]
impl IntoIterator for EventBuffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for EventBuffer
impl Send for EventBuffer
impl Sync for EventBuffer
impl Unpin for EventBuffer
impl UnwindSafe for EventBuffer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,