py_cui
py_cui copied to clipboard
add escape_unfocuses field to PyCUI
More control over Escape / focus behavior. For use cases like single-widget applications and those that never want to go out of focus mode
- [x] I have read the contribution guidelines
- [x] CI Unit tests pass
- [x] New functions/classes have consistent docstrings
What this pull request changes
- add
escape_unfocuses
field to PyCUI objects, defaultTrue
. If set toFalse
, user can provide widget-specific behavior for when Esc is pressed.
Issues fixed with this pull request
- #135 (with
escape_unfocuses == False
you can dowidget.add_key_command(py_cui.keys.KEY_ESCAPE, foo)
)
I've thought about this, and would it perhaps be better to have the unfocus key be settable? With KEY_ESCAPE
just the default? We could even add the option to set it to None
so that there is no default unfocus key
Agreed
-------- Original Message -------- On 29 Dec 2021, 21:09, Jakub Wlodek wrote:
I've thought about this, and would it perhaps be better to have the unfocus key be settable? With KEY_ESCAPE just the default? We could even add the option to set it to None so that there is no default unfocus key
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>