0

I am trying to figure out how to listen for a mouse click/hold inside a cmd-line window. Additionally the position of the click (line, col) needs to be returned too.

Background - clickable menu for a command line only game. I don’t want a tab based or keyboard based solution. Non browser based, local cli only.

Are there any console commands that expose this information, or is it possible to get this information via Python using only the standard library?

I'm open to win32api, but bonus if there is an OS-independent way of doing so.

Specifically, see NVRM's comment, which works for PHP, how can I do the same in Python? how to get MouseMove and MouseClick in bash?

  • This might be a job for NCURSES. https://www.gnu.org/software/ncurses/ncurses.html If you come back to SO with a question, please be sure to include the code you are trying to make work. https://stackoverflow.com/help – lit Jul 08 '21 at 21:17
  • https://stackoverflow.com/a/6285501/447901 – lit Jul 08 '21 at 21:19
  • @lit I don't know how to do the same in Python, any further guidance? – ab_Dominoble_dev Jul 08 '21 at 21:30
  • https://www.devdungeon.com/content/curses-programming-python – lit Jul 08 '21 at 21:46

0 Answers0