Skip to content

Add some values to enum Keys#2040

Open
Freed-Wu wants to merge 1 commit intoprompt-toolkit:mainfrom
Freed-Wu:enter
Open

Add some values to enum Keys#2040
Freed-Wu wants to merge 1 commit intoprompt-toolkit:mainfrom
Freed-Wu:enter

Conversation

@Freed-Wu
Copy link
Contributor

@Freed-Wu Freed-Wu commented Dec 9, 2025

Fix #2006.
Although Keys.ShiftEnter, Keys.ControlEnter, Keys.ControlShiftEnter cannot work,
(Keys.Escape, Keys.ControlEnter) and (Keys.Escape, Keys.ControlShiftEnter) can work.
Before this PR, we have to:

@add_key_binding(Keys.Escape, *"[27;8;13~")
def _(event: KeyPressEvent) -> None:
    ...

Now we can:

@add_key_binding(Keys.Escape, Keys.ControlShiftEnter)
def _(event: KeyPressEvent) -> None:
    ...

Fix prompt-toolkit#2006.
Although Keys.ShiftEnter, Keys.ControlEnter, Keys.ControlShiftEnter cannot work,
(Keys.Escape, Keys.ControlEnter) and (Keys.Escape, Keys.ControlShiftEnter) can work.
Before this PR, we have to:

    @add_key_binding(Keys.Escape, *"[27;8;13~")
    def _(event: KeyPressEvent) -> None:
        ...

Now we can:

    @add_key_binding(Keys.Escape, Keys.ControlShiftEnter)
    def _(event: KeyPressEvent) -> None:
        ...
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.

[feature] support c-enter/c-s-enter/s-enter

1 participant