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

Event::CtrlShift(char)? #516

Closed
TianyiShi2001 opened this issue Oct 8, 2020 · 2 comments
Closed

Event::CtrlShift(char)? #516

TianyiShi2001 opened this issue Oct 8, 2020 · 2 comments

Comments

@TianyiShi2001
Copy link
Contributor

TianyiShi2001 commented Oct 8, 2020

Question: Currently (in the latest master branch) it seems that only Event::Shift(char) and Event::CtrlShift(<non-character-key>), but not Event::CtrlShift(char), can be processed. Is it going to be implemented in the future? Are there any workarounds for now?

This feature would be helpful to me because I'm implementing a sudoku game, and it is conventional to map Ctrl + Z to undo and Ctrl + Shift + Z to redo.

Event::CtrlChar('z') => self.undo(),
Event::CtrlChar('Z') => self.redo(), // tried this, doesn't work
Event::CtrlShift(Key::???) => self.redo(), // Key::Char?

BTW can #503 be merged? I was a bit late for the final comment, bit I think it's ready to be merged.

@gyscos
Copy link
Owner

gyscos commented Oct 8, 2020

Hi, and thanks for the PR!

Unfortunately I don't think terminal application can tell the difference between C-z and C-Z: in both cases the same input code is sent by the terminal emulator (this is why there is no Event::CtrlShift(char), to prevent the confusion from this never happening). One of the limitations of terminals... :(

@TianyiShi2001
Copy link
Contributor Author

Thank you!

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