Home

Awesome

Term Mouse

A mouse reporting interface

Originally based on TooTallNate's gist, rewritten to use all the mouse reporting modes.

Example

var mouse = require('term-mouse')();

mouse
	.start()
	.on('click', function(e) {
		console.log('you clicked %d,%d with the %s mouse button', e.x, e.y, e.button /* 'left', 'middle' or 'right' */);
	})
	.on('scroll', function(e) {
		console.log('you scrolled %s', e.button /* 'up' or 'down' */);
	});

API

var mouse = require('term-mouse')(options);

Options:

Events:

All of these include an event object:

Useful References

I looked at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html and https://www.systutorials.com/docs/linux/man/7-urxvt/ while making this.