-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why shift is hardcoded here ? #68
Comments
It's very misleading, when I write something like this for example and It always receives false. Input {
key: Key::Enter,
ctrl: false,
shift: is_shift,
..
} => {
if is_shift {
textarea.insert_new_line();
}
} |
I've got the same issue! I've been agonizing over it. Any way to activate it? |
I guess we can use crossterm::event::KeyCode, instead of using Input from tui-textarea, because KeyCode implements Into<Input>, but i didn't check if it works. let timeout = Duration::from_millis(10);
if event::poll(timeout)? {
if let Event::Key(key_event) = event::read()? {
match key_event.code {
KeyCode::Enter if key_event.modifiers.contains(KeyModifiers::Shift) => {}
_ => self.textarea.input(key_event.into())
}
}
} |
I've checked this and with crossterm::KeyCode it also doesn't work. Idk why. |
Because termion does not provide a way to handle shift modifier state.
https://docs.rs/termion/latest/termion/event/enum.Key.html There are some key combinatons with shift key like Instead, termion sends the input key as-is. For example, when So I thought If there is a nice way to properly set the |
I added some more combinations with arrow keys at 0e32eed. termion added support for those combinations at v4. As long as shift + arrow keys combinations, |
fix #68 termion added the support at this commit: redox-os/termion@3b52dc9
tui-textarea/src/input/termion.rs
Line 51 in 39075bb
Why shift is hardcoded here as always false ? This is why I can't make combinations like Shift+Enter for example.
The text was updated successfully, but these errors were encountered: