survey icon indicating copy to clipboard operation
survey copied to clipboard

Provide a way to detect if the Esc key (or any other key) has been pressed.

Open PrMinisterGR opened this issue 6 years ago • 5 comments

I would like to use Esc to go to different places in a loop, but the way survey intercepts it, it's currently impossible.

Thank you for your work!

PrMinisterGR avatar Sep 27 '19 10:09 PrMinisterGR

Could you give small example and some details about your usecase?

dineshba avatar Oct 03 '19 08:10 dineshba

Hey, I would love to show a multi select and be able to detect Esc (like I can do with other keys), to return err on the function running it.

PrMinisterGR avatar Nov 14 '19 14:11 PrMinisterGR

Thanks for the submission @PrMinisterGR! And thanks for following up @dineshba!!

I discussed trapping esc awhile back when we adding the vim mode. I think that addition was probably a bit pre-emptive since I now thing the esc is better used to get out of options like you might be hoping to do. Unforunately, since it would introduce a breaking change to the API, i have been holding off on removing it until v3. I know this isn't quite the answer you want but it's the best I can do right now 😦

AlecAivazis avatar Feb 17 '20 09:02 AlecAivazis

No worries, as long as it's eventually fixed, that will be great.

PrMinisterGR avatar Feb 17 '20 19:02 PrMinisterGR

Are there any methods currently to capture escape? I notice (Ubuntu) that a selection flashes when escape is pressed.

I could implement an "ErrorOnEscape" field to the Select struct. Let me know if that would be breaking @AlecAivazis

skelouse avatar Jan 28 '23 08:01 skelouse