tui-textarea
tui-textarea copied to clipboard
What is the input.cmd for ⌘ for Mac?
I don't think input.ctrl works. input.alt doesn't work either. Is there an input.cmd that works for Mac?
Ok, I'm a beginner scrub and I think ⌘ is not reliable for TUIs. Please close this if that's the case, thanks!
For context I was trying to make a good paste experience, because the _ handler for match is too slow for pasting with cmd + v.
But I think i'll just recommend ctrl+v / opt+v / alt+v.
I think this is good:
pub fn handlekeys_text_area(&mut self, input: Input) {
match input.key {
Key::Char('v') if input.ctrl || input.alt => {
if let Ok(mut ctx) = arboard::Clipboard::new() {
if let Ok(text) = ctx.get_text() {
self.inputs[self.current_input].insert_str(&text);
}
}
}
_ => {
self.inputs[self.current_input].input(input);
}
}
}