Now Pygame and Qt keycodes are easily accessible. Yes, they return different values, so you need to code for your platform. Or maybe use the keyboard module instead of platform-specific stuff. Oh! I should write a console version that uses only that. ;-)
Run:
pip install -r requirements.txt
Then:
python keycodes_qt.py
Or:
python keycodes_pygame.py
Happy coding!