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

Detecting escape much slower than control+c #73

Open
Lucas256-cmd opened this issue Jan 27, 2024 · 0 comments
Open

Detecting escape much slower than control+c #73

Lucas256-cmd opened this issue Jan 27, 2024 · 0 comments

Comments

@Lucas256-cmd
Copy link

When I define custom keybinds like in the code below, detecting escape takes much longer (minimum 1.5 seconds) to detect than ctrl+c. Why is this? And how can it be fixed please?

# import libraries
from InquirerPy import inquirer
from InquirerPy.base.control import Choice


# create basic prompt
prompt_answer = inquirer.select(
    message="select an action",
    choices=[
        Choice("add", "Add"),
        Choice("remove", "Remove"),
        Choice("edit", "Edit"),
        Choice("print", "Print"),
        Choice("settings", "Settings"),
        Choice("help", "Help"),
        Choice("quit", "Quit"),
    ],
    raise_keyboard_interrupt=False,
    keybindings={"skip": [{"key": "escape"}], "interrupt": [{"key": "c-e"}]},
    mandatory=True,
)


# define function to handle escape key

prompt_answer.execute()

Thanks in advance

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

1 participant