pub struct EventBuffer(pub Vec<Event>);
Expand description
The event buffer is a simple wrapper around a Vec<simulate::Event>
.
Tuple Fields§
§0: Vec<Event>
Implementations§
Source§impl EventBuffer
impl EventBuffer
Sourcepub fn with_capacity(cap: usize) -> Self
pub fn with_capacity(cap: usize) -> Self
Creates a new EventBuffer
with the given capacity. (see Vec::with_capacity
)
Sourcepub fn extend(&mut self, events: impl IntoIterator<Item = Event>)
pub fn extend(&mut self, events: impl IntoIterator<Item = Event>)
Inserts multiple events into the buffer. (see Vec::extend
)
Sourcepub fn extend_from_slice(&mut self, events: &[Event])
pub fn extend_from_slice(&mut self, events: &[Event])
Extends the buffer from a slice of events. (see Vec::extend_from_slice
)
Sourcepub fn append(&mut self, events: &mut EventBuffer)
pub fn append(&mut self, events: &mut EventBuffer)
Appends the elements of another buffer to this one, living the other
one empty. (see Vec::append
)
Sourcepub fn add_multiple<K: Keylike>(&mut self, keys: impl IntoIterator<Item = K>)
pub fn add_multiple<K: Keylike>(&mut self, keys: impl IntoIterator<Item = K>)
Adds Press
and Release
events for multiple keylikes into the buffer.
Sourcepub fn send(&mut self, key: impl Keylike)
pub fn send(&mut self, key: impl Keylike)
Adds a Press
and a Release
event for the given keylike.
Sourcepub fn type_str(&mut self, s: &str)
pub fn type_str(&mut self, s: &str)
Adds Press
and Release
events for each character of the string.
Sourcepub fn move_mouse_relative(&mut self, dx: i32, dy: i32)
pub fn move_mouse_relative(&mut self, dx: i32, dy: i32)
Adds an event that causes the mouse to move dx
pixels to the right
and dy
pixels down.
Sourcepub fn move_mouse_absolute(&mut self, x: f32, y: f32)
pub fn move_mouse_absolute(&mut self, x: f32, y: f32)
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.
Sourcepub fn add_scroll_event(&mut self, delta: f32, direction: ScrollDirection)
pub fn add_scroll_event(&mut self, delta: f32, direction: ScrollDirection)
Adds a scroll event to the buffer.
Sourcepub fn scroll_horizontal(&mut self, delta: f32)
pub fn scroll_horizontal(&mut self, delta: f32)
Uses the mouse wheel horizontally.
Trait Implementations§
Source§impl Clone for EventBuffer
impl Clone for EventBuffer
Source§fn clone(&self) -> EventBuffer
fn clone(&self) -> EventBuffer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more