tui-textarea icon indicating copy to clipboard operation
tui-textarea copied to clipboard

What is the input.cmd for ⌘ for Mac?

Open Blankeos opened this issue 4 months ago • 2 comments

I don't think input.ctrl works. input.alt doesn't work either. Is there an input.cmd that works for Mac?

Blankeos avatar Oct 22 '25 03:10 Blankeos

Ok, I'm a beginner scrub and I think is not reliable for TUIs. Please close this if that's the case, thanks!

Blankeos avatar Oct 22 '25 03:10 Blankeos

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);
            }
        }
    }

Blankeos avatar Oct 22 '25 03:10 Blankeos