mouse-tool
A C program/library that allows you to easily read and parse mouse click events in the terminal. Instead of switching terminals in SGR and fiddling around, just use mouse-tool!
language: C
release date: 2026-01-04
about
The mouse-tool program is a very convenient tool/library that allows you to easily record mouse click events within the terminal.
Instead of switching the terminal to SGR mode and trying to parse the data thrown at the tty, just use the mouse-tool, which clearly shows where and with what you clicked.
Instead of switching the terminal to SGR mode and trying to parse the data thrown at the tty, just use the mouse-tool, which clearly shows where and with what you clicked.
features
The program clearly displays click coordinates on the terminal—row, column, and button number. Data can be retrieved in JSON or CSV format. Single-click, multi-click (click multiple times in one place to get the truth), click-to-series recording, and much more are supported.
Some languages have ready-made libraries that allow you to read touch points on the terminal, but... not all of them.
My tool now allows you to handle click location in any language (like Bash, which I love). There's a simple script in the GitHub repository that lets you test this.
Check it out! ;)
Some languages have ready-made libraries that allow you to read touch points on the terminal, but... not all of them.
My tool now allows you to handle click location in any language (like Bash, which I love). There's a simple script in the GitHub repository that lets you test this.
Check it out! ;)
compatibility
The script requires no dependencies (except for the compiler environment), so it can run on virtually any Unix system. Written in C, it's fast, simple, and reliable.