Home > Mobile >  Is there a way to get the mouse position within the terminal?
Is there a way to get the mouse position within the terminal?

Time:12-12

I am currently coding a node.js program relating to mouse coordinates. Is there a way to see the mouse position in the terminal in Node.JS?

I've tried the ways beginning in \e but they only list the cursor position. How do I get the mouse position in the terminal? Example

Is there a way to get said position in the "Row/Column" or "Column/Row" format? If there is no way, what about using child_process?

CodePudding user response:

You can take a look at RobotJS it can show you where the mouse position is. You can use 'getmousepos' function to get the X and Y coordinates of the mouse on the screen

NPM: https://www.npmjs.com/package/robotjs

Doc: https://robotjs.io/docs/syntax#getmousepos

  • Related