Closed landersson closed 1 year ago
Hi,
I just noticed that pressing Enter does not activate UI buttons as expected under Linux.
https://github.com/bczsalba/pytermgui/blob/70f2f580256bc88037434319cc90b69041f545e2/pytermgui/widgets/button.py#L82
I've temporarily worked around the issue by changing the line above to:
if (key == keys.RETURN or key=="\r") and self.onclick is not None:
But there is probably a better and more global way of making sure Enter (CTRL-M or '\r') activates a button.
That turned out to (mostly) be the solution! Just added keys.CARRIAGE_RETURN as \r, and used that instead. Thanks for the sHout~!
keys.CARRIAGE_RETURN
\r
Hi,
I just noticed that pressing Enter does not activate UI buttons as expected under Linux.
https://github.com/bczsalba/pytermgui/blob/70f2f580256bc88037434319cc90b69041f545e2/pytermgui/widgets/button.py#L82
I've temporarily worked around the issue by changing the line above to:
But there is probably a better and more global way of making sure Enter (CTRL-M or '\r') activates a button.