Skip to content
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

KeyModifiers and KeyCode::Enter #400

Closed
extrawurst opened this issue Mar 18, 2020 · 1 comment
Closed

KeyModifiers and KeyCode::Enter #400

extrawurst opened this issue Mar 18, 2020 · 1 comment

Comments

@extrawurst
Copy link
Contributor

Describe the bug
No Modifiers are provided for KeyEvent with the Enter Key. In fact in my test almost only the arrow keys provided the correct modifier keys. Looking at this code I am wondering if its actually only provided for the arrow keys:

let input_event = match (modifier, key) {
(53, 65) => Event::Key(KeyEvent::new(KeyCode::Up, KeyModifiers::CONTROL)),
(53, 66) => Event::Key(KeyEvent::new(KeyCode::Down, KeyModifiers::CONTROL)),
(53, 67) => Event::Key(KeyEvent::new(KeyCode::Right, KeyModifiers::CONTROL)),
(53, 68) => Event::Key(KeyEvent::new(KeyCode::Left, KeyModifiers::CONTROL)),
(50, 65) => Event::Key(KeyEvent::new(KeyCode::Up, KeyModifiers::SHIFT)),
(50, 66) => Event::Key(KeyEvent::new(KeyCode::Down, KeyModifiers::SHIFT)),
(50, 67) => Event::Key(KeyEvent::new(KeyCode::Right, KeyModifiers::SHIFT)),
(50, 68) => Event::Key(KeyEvent::new(KeyCode::Left, KeyModifiers::SHIFT)),
_ => return Err(could_not_parse_event_error()),

To Reproduce
Running the event-poll-read example and pressing SHIFT+ENTER prints:

Event::Key(KeyEvent { code: Enter, modifiers: NONE })

Expected behavior
the correct modifier in the KeyEvent

OS
MacOS

Terminal/Shell
iTerm (Zsh)

@TimonPost
Copy link
Member

image

It seems like this sequence is not supported by the terminal, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants