pub struct Combiner { /* private fields */ }Expand description
Consumes key events and combines them into key combinations.
See the print_key_events example.
Implementations§
source§impl Combiner
impl Combiner
sourcepub fn enable_combining(&mut self) -> Result<bool>
pub fn enable_combining(&mut self) -> Result<bool>
Try to enable combining more than one non-modifier key into a combination.
Return Ok(false) when the terminal doesn’t support the kitty protocol.
A downside of combining is that key combinations are produced on key release instead of key press, which may feel “slower”.
Behind the scene, this function pushes the keyboard enhancement flags to the terminal. The flags are popped, and the normal state of the terminal restored, when the Combiner is dropped.
pub fn is_combining(&self) -> bool
sourcepub fn transform(&mut self, key: KeyEvent) -> Option<KeyCombination>
pub fn transform(&mut self, key: KeyEvent) -> Option<KeyCombination>
Receive a key event and return a key combination if one is ready.
When combining is enabled, the key combination is only returned on a key release event.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Combiner
impl Send for Combiner
impl Sync for Combiner
impl Unpin for Combiner
impl UnwindSafe for Combiner
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