petereon / beaupy

A Python library of interactive CLI elements you have been looking for
https://petereon.github.io/beaupy/
MIT License
183 stars 13 forks source link

feat: add the actual key that was used to trigger a KeyboardInterrupt #33

Closed MatanRubin closed 1 year ago

MatanRubin commented 1 year ago

The key that the user pressed to trigger the KeyboardInterrupt is now added to the exception as the first argument. This is useful for handling interrupts triggered by different keys in different ways. For example: using Ctrl-C to quit, and ESC (or some other key) as a "back" button.

petereon commented 1 year ago

Thanks for a PR. Great idea, breaks nothing. I am merging and releasing.