magmax / python-readchar

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

fixed character numbers for windows #75

Closed computermax11 closed 2 years ago

computermax11 commented 2 years ago

The readkey code uses getch to get the character number for the arrow keys in windows, but it uses the formula a + ( b * 256 ) to get the character numbers. a being the escape with value 224. In the xlate_dict the numbers do not include the extra 224 from a so the keys don't work.

Cube707 commented 2 years ago

This is very funny, as #65 did the exact opposit XD.

This is a generall problem with the lookuptable. the value for a can be both 0 or 224 (no Idea when its which value). The table only contains lookups for one of this cases and is currently not consistent in which values are used. (#66 explains this in detail)

I fixed this and a few more windows specific things in #71, which still waits on beeing merged.