Due to the way readchar currently handles terminal setup, we cannot control terminal behaviour outside of the two readchar functions. This leads to issues #62 and #73
We could solve this by externalising terminal setup and teardown and have it run at the beginning and end, ensuring consistent behaviour in between. Under python this calls for a Context Manager
Requirements would be:
Here is an example of how it could work:
With ReadChar() as read:
if read.key_iswaiting():
print(read.key())
#other stuff in parallel #
sleep(0.5)
If this is working an properly set up, I could replace the existing functions and they could be simply wrappers for this.
Due to the way readchar currently handles terminal setup, we cannot control terminal behaviour outside of the two readchar functions. This leads to issues #62 and #73
We could solve this by externalising terminal setup and teardown and have it run at the beginning and end, ensuring consistent behaviour in between. Under python this calls for a
Context ManagerRequirements would be:
CTRL+Cetc. As normal keystrokesand handle themHere is an example of how it could work:
If this is working an properly set up, I could replace the existing functions and they could be simply wrappers for this.