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

Being able to bind Shift+Enter to something else #653

Closed
ghigt opened this issue Oct 3, 2022 · 3 comments
Closed

Being able to bind Shift+Enter to something else #653

ghigt opened this issue Oct 3, 2022 · 3 comments

Comments

@ghigt
Copy link

ghigt commented Oct 3, 2022

While this works in the example folder:

rl.bind_sequence(
    KeyEvent(KeyCode::Char('s'), Modifiers::CTRL),
    EventHandler::Simple(Cmd::Newline),
);

This is handled by the default Enter behavior:

rl.bind_sequence(
    KeyEvent(KeyCode::Enter, Modifiers::SHIFT),
    EventHandler::Simple(Cmd::Newline),
);

Is it expected or is it a bug?

@gwenn
Copy link
Collaborator

gwenn commented Oct 3, 2022

On Windows, it may be possible.
But on Unix, by default, there is no way to make the distinction between SHIFT-Enter / CTRL-Enter and Enter.
See https://unix.stackexchange.com/questions/536352/ctrl-enter-shift-enter-and-enter-are-interpreted-as-the-same-key

@ghigt ghigt closed this as completed Oct 26, 2022
@patrik-simunic-cz
Copy link

Well..... how does the Node REPL handle this then?
Since it's working in there, there obviously has to be a way to distinguish between Enter and SHIFT+Enter(?)

@gwenn
Copy link
Collaborator

gwenn commented Sep 1, 2024

#744

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

3 participants