Skip to content

fixes windows composite key: #102 - add composite key#103

Merged
pksunkara merged 3 commits intoconsole-rs:masterfrom
Archina:fix/#102/windowsUnknownKey
Aug 13, 2021
Merged

fixes windows composite key: #102 - add composite key#103
pksunkara merged 3 commits intoconsole-rs:masterfrom
Archina:fix/#102/windowsUnknownKey

Conversation

@Archina
Copy link
Copy Markdown
Contributor

@Archina Archina commented Aug 13, 2021

pksunkara
pksunkara previously approved these changes Aug 13, 2021
@pksunkara
Copy link
Copy Markdown
Collaborator

pksunkara commented Aug 13, 2021

Okay, what is a composite key and how is it related to macos and linux?

@pksunkara pksunkara dismissed their stale review August 13, 2021 12:42

Hurried

@Archina
Copy link
Copy Markdown
Contributor Author

Archina commented Aug 13, 2021

As stated in the linked issue, the composite key does not really exist. It also does not relate to linux. The mapping is more for the Alt key - however, calling it Key::Alt seemed misleading as the mapping within winapi seems to be incorrect as well (it points to the Menu key instead).

The issue is that the windows term generates Key::Unknown + Key::Char events when using this technique. (You should be able to reproduce this by using altGr + / to create a ¿ character). This causes dialoguer to crash.

@pksunkara
Copy link
Copy Markdown
Collaborator

If you check https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes, VK_MENU is ALT key. So, instead of composite, let's put Key::Alt

@Archina
Copy link
Copy Markdown
Contributor Author

Archina commented Aug 13, 2021

Then I misunderstood that. I will use Key::Alt then instead. Thank you very much!

@pksunkara pksunkara linked an issue Aug 13, 2021 that may be closed by this pull request
@pksunkara pksunkara merged commit fa487a2 into console-rs:master Aug 13, 2021
dtolnay pushed a commit to dtolnay-contrib/console that referenced this pull request Feb 4, 2022
Based on some [earlier feedback][1], this PR changes the proto
definition so readiness of a poll op is represented via a bool. The
relevant changes have been made to:
tokio-rs/tokio#4072

[1]: tokio-rs/console#77 (comment)

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
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

Successfully merging this pull request may close these issues.

Text input yields Key::Unknown on windows_term using alt

2 participants