pub struct MouseSelectOptions { /* private fields */ }Expand description
Configuration options for mouse-based text selection.
Use the builder pattern to configure selection behavior:
use beamterm_renderer::mouse::{MouseSelectOptions, ModifierKeys};
use beamterm_renderer::SelectionMode;
let options = MouseSelectOptions::new()
.selection_mode(SelectionMode::Block)
.require_modifier_keys(ModifierKeys::SHIFT)
.trim_trailing_whitespace(true);Implementations§
Source§impl MouseSelectOptions
impl MouseSelectOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new MouseSelectOptions with default settings.
Defaults:
- Selection mode:
Block - Required modifier keys: none
- Trim trailing whitespace:
false
Sourcepub fn selection_mode(self, mode: SelectionMode) -> Self
pub fn selection_mode(self, mode: SelectionMode) -> Self
Sets the selection mode (Linear or Block).
Linear: Selects text following the natural reading orderBlock: Selects a rectangular region of cells
Sourcepub fn require_modifier_keys(self, require_modifier_keys: ModifierKeys) -> Self
pub fn require_modifier_keys(self, require_modifier_keys: ModifierKeys) -> Self
Sets modifier keys that must be held for selection to activate.
When set, mouse selection only begins if the specified modifier
keys are pressed during the initial click. Use ModifierKeys::empty()
to allow selection without any modifiers (the default).
§Example
use beamterm_renderer::mouse::{MouseSelectOptions, ModifierKeys};
// Require Shift+Click to start selection
let options = MouseSelectOptions::new()
.require_modifier_keys(ModifierKeys::SHIFT);
// Require Ctrl+Shift+Click
let options = MouseSelectOptions::new()
.require_modifier_keys(ModifierKeys::CONTROL | ModifierKeys::SHIFT);Sourcepub fn trim_trailing_whitespace(self, trim: bool) -> Self
pub fn trim_trailing_whitespace(self, trim: bool) -> Self
Sets whether to trim trailing whitespace from selected text.
When enabled, trailing spaces at the end of each line are removed from the copied text.
Trait Implementations§
Source§impl Clone for MouseSelectOptions
impl Clone for MouseSelectOptions
Source§fn clone(&self) -> MouseSelectOptions
fn clone(&self) -> MouseSelectOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MouseSelectOptions
impl Debug for MouseSelectOptions
Source§impl Default for MouseSelectOptions
impl Default for MouseSelectOptions
Source§fn default() -> MouseSelectOptions
fn default() -> MouseSelectOptions
Returns the “default value” for a type. Read more
impl Copy for MouseSelectOptions
Auto Trait Implementations§
impl Freeze for MouseSelectOptions
impl RefUnwindSafe for MouseSelectOptions
impl Send for MouseSelectOptions
impl Sync for MouseSelectOptions
impl Unpin for MouseSelectOptions
impl UnwindSafe for MouseSelectOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more