magmax / python-readchar

Python library to read characters and key strokes
MIT License
143 stars 43 forks source link

v3.0.6 development (Quick fixes for broken v3.0.5) #76

Closed Cube707 closed 2 years ago

Cube707 commented 2 years ago

As #71 is quite complex and introduces some braking changes, I also provide this PR to just fixes the immediate problems and roll out a new version to replace the broken Version 3.0.5. This should take care of #75 and the multitude of linked issues on #66 and #71

Changes

This PR reverts the bad PR #65, which broke BACKSPACE for Linux systems as well as making the windows scancode lookuptable more inconsistent (see here and #66).

The wrong BACKSPACE code is addressed by a separate check on the windows side, same for ENTER, which is also different on Windows. The lookuptable is completed with the missing values, fixing the inconsistencies.

I bumped black in the pre-commit-config.yaml as 22.1.0 is broken and would not run

I removed Python 2.7 and pypy from the list of supported version, as it is no longer tested and probably doesn't work. I reverted this as it should be handled as part of the v4 release in my opinion.

Problems

The pre-commit test won't complete, as the if statement contaning all of the windows code is to complex. But as this is only suppoesed to be a quick fix before v4.0 I wound't bother with that.

closes #75 closes #57

caphrim007 commented 2 years ago

I pulled this PR and verified it works to correct the backspace problem I'm observing in python-inquirer. fancy a merge and release?

Cube707 commented 2 years ago

as the maintainer is currently not responding, I have prepared a temporary workaround: Whoever need this urgently can install it from my fork by using git+https://github.com/Cube707/python-readchar.git@v3.0.6 either in a requirements.txt file or directly from the comandline as:

pip install git+https://github.com/Cube707/python-readchar.git@v3.0.6

it is marked as version 3.0.6-dev0, so it will override a existing 3.0.5 installation but will be overriden by a official version 3.0.6 release (when it's released...).