bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.16k stars 53 forks source link

Windows mouse support #122

Closed Tired-Fox closed 1 year ago

Tired-Fox commented 1 year ago

Use Win32 API to enable mouse input and to make all input events input as ansi codes.

The context manager that handles this is only imported on windows otherwise a dummy context manager is used. This is because the console mode needs to be set up before the getch loop.

Tested on both windows and linux and the input works.

bczsalba commented 1 year ago

Tried it on MacOS and it works here, so Linux should be fine too. If it works for Windows in any capacity, I welcome the change!

Thank you!