pub struct PressEvent<'alloc> { /* private fields */ }Expand description
Opaque handle to reusable input data for selection gesture press operations.
Implementations§
Source§impl<'alloc> PressEvent<'alloc>
impl<'alloc> PressEvent<'alloc>
Sourcepub fn new_with_alloc<'ctx: 'alloc>(
alloc: &'alloc Allocator<'ctx>,
) -> Result<Self>
pub fn new_with_alloc<'ctx: 'alloc>( alloc: &'alloc Allocator<'ctx>, ) -> Result<Self>
Create a new selection gesture press event instance with a custom allocator.
See the crate-level documentation regarding custom memory management and lifetimes.
Sourcepub fn set_position(&mut self, x: f64, y: f64) -> Result<&mut Self>
pub fn set_position(&mut self, x: f64, y: f64) -> Result<&mut Self>
Set the surface-space pointer position.
Sourcepub fn set_repeat_distance(&mut self, value: f64) -> Result<&mut Self>
pub fn set_repeat_distance(&mut self, value: f64) -> Result<&mut Self>
Set the maximum repeat-click distance in pixels.
Sourcepub fn set_time(&mut self, value: Duration) -> Result<&mut Self>
pub fn set_time(&mut self, value: Duration) -> Result<&mut Self>
Set the monotonic event time.
If unset, press treats the event as untimed and only single-click behavior is available.
Intervals above u64::MAX nanoseconds in length will be
silently truncated.
Sourcepub fn set_repeat_interval(&mut self, value: Duration) -> Result<&mut Self>
pub fn set_repeat_interval(&mut self, value: Duration) -> Result<&mut Self>
Set the maximum interval between repeat clicks.
Intervals above u64::MAX nanoseconds in length will be
silently truncated.
Sourcepub fn set_word_boundary_codepoints(
&mut self,
value: &[char],
) -> Result<&mut Self>
pub fn set_word_boundary_codepoints( &mut self, value: &[char], ) -> Result<&mut Self>
Set the word-boundary codepoints.
The codepoints are copied into event-owned storage when set. If unset, operations that need word boundaries use Ghostty’s defaults.
Sourcepub fn set_behaviors(&mut self, value: &Behaviors) -> Result<&mut Self>
pub fn set_behaviors(&mut self, value: &Behaviors) -> Result<&mut Self>
Set the selection behavior table.
If unset, press uses the default behavior table: cell, word, line.