Module to get mouse events in whole screen


I am currently looking for a module that can give mouse button stats in screen.
Do someone know one ?

Thanks in advance.



If you want stats to mouse click right, you can used “context-menu” event

With Jquery library by exemple
(document).click(function(event) { isTrueClick = event.originalEvent.isTrusted; ... }) (document).on( “scroll”,function(event) {



Thanks Shmuel83 for your help, when I am saying “screen” I am not saying the browser window I am saying the WHOLE screen, the OS screen.

Will $(document) refer to the OS screen or the browser window ?



You must used/created a module to do that.
I don’t find an npm module, but maybe, you can see robotjs : For mouse control, but not for event click


There is a copy function in the source code to get mouse buttons but not available in the final module


I find maybe the module that you have need :


Thanks, but node-mouse only works with linux mouses


Robotjs controls the mouse and can only get mouse position