magmax / python-readchar

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

Add support for FreeBSD. #78

Closed trombonehero closed 2 years ago

trombonehero commented 2 years ago

Use readchar_linux on FreeBSD too, like on Linux and Darwin. This seems to run fine.

Cube707 commented 2 years ago

Hello, I added your commit to #79. Could you please run the manual testscript (in tests/manual-test.py) on a FreeBSD system and verify that it works with most characters/keys?

also if you want to you could remove the platfrom checks here:

https://github.com/Cube707/python-readchar/blob/f20f57f0e01bbda4bf6ca55035c87b5b4dbcbbfb/tests/posix/conftest.py#L4-L13

and check if the tests complete on a FreeBSD system as well.

Cube707 commented 2 years ago

Duplicate of #46

trombonehero commented 2 years ago

Hello, I added your commit to #79. Could you please run the manual testscript (in tests/manual-test.py) on a FreeBSD system and verify that it works with most characters/keys?

also if you want to you could remove the platfrom checks here:

https://github.com/Cube707/python-readchar/blob/f20f57f0e01bbda4bf6ca55035c87b5b4dbcbbfb/tests/posix/conftest.py#L4-L13

and check if the tests complete on a FreeBSD system as well.

Sorry that I missed this earlier. I've now done this and all of the tests pass... I can submit that as a separate pull request.

trombonehero commented 2 years ago

I've created a pull request (#86) to run the tests on *bsd* platforms.

Cube707 commented 2 years ago

@trombonehero

I've now done this and all of the tests pass...

Great, if you have the time it would be amazing to have some screenshots here of whats working on FreeBSD to have it documented for the future. But no pressure, if you don't have the time / can't be bother to do it, the issue is allready closed and will just stay undocumented...

trombonehero commented 1 year ago

Some results of the manual tests (which all seemed to work):

a - \x61
b - \x62
c - \x63
d - \x64
e - \x65
f - \x66
g - \x67
got SPACE - \x20
x1b\x1b
got TAB - \x09
got LF - \x0a
\ - \x5c
got BACKSPACE - \x7f
got CTRL_F - \x06
got CTRL_D - \x04
d - \x64
1 - \x31
2 - \x32
3 - \x33
! - \x21
@ - \x40
# - \x23
got F1 - \x1b\x4f\x50
got F2 - \x1b\x4f\x51
got F3 - \x1b\x4f\x52
got F4 - \x1b\x4f\x53
got UP - \x1b\x5b\x41
got LEFT - \x1b\x5b\x44
got DOWN - \x1b\x5b\x42
got RIGHT - \x1b\x5b\x43
| - \x7c