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

Supporting multiple modifier key recognition (like Ctrl+Shift) #515

Open
curlpipe opened this issue Nov 22, 2020 · 4 comments
Open

Supporting multiple modifier key recognition (like Ctrl+Shift) #515

curlpipe opened this issue Nov 22, 2020 · 4 comments

Comments

@curlpipe
Copy link

curlpipe commented Nov 22, 2020

Is your feature request related to a problem? Please describe.
This is a great library, probably one of the most complete libraries I have found. The problem I'm finding is that the users of my program (that uses Crossterm) wish to be able to use keyboard shortcuts such as Ctrl+Shift and Alt+Shift etc... When I try implementing these modifiers, it just registers as usual Ctrl and Alt keys.

Describe the solution you'd like
I'd like to be able to bind multiple modifier keys on top of each other. E.g. Ctrl + Shift + S or Ctrl + Alt + R etc...

Describe alternatives you've considered in any
Not really sure how to get around this, I could maybe write some janky code to work around this using another library or using libc for now but I don't want to go into that territory.

Additional Info
This can kinda fit into issue #510 as I think it's mentioned there
But I wanted to make it clearer

Many thanks :)

@vlisivka
Copy link

Example key codes sent by gnome-terminal:

Up: \e[A
Shift Up: \e[1;2A
Alt Up: \e[1;3A
Shift+Alt Up: \e[1;4A
Control Up: \e[1;5A
Control+Shift Left: \e[1;6D

@pianohacker
Copy link
Contributor

Can this be closed with the addition of the keyboard enhancement feature to 0.25?

@kyoheiu
Copy link

kyoheiu commented Jul 19, 2023

Is this implemented? In my app I tried to catch Ctrl + Shift + c (Ctrl + C) but couldn't.
FYI, changing the key from c to e.g. 'z' does not work either.
If I miss something, please let me know.

@LevitatingBusinessMan
Copy link
Contributor

This can be done using the KeyboardEnhancementFlags if you have a terminal that supports it.

As of two weeks, it is supported by Alacritty: alacritty/alacritty@cb03806

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

5 participants