Mouse Handler

About Mouse Handler

Mouse Handler provides simplified usage of mousce click events. In the current version clicks take take longer than 0.3 seconds are considered as text marking actions, ignoring the click. Other may be added. To use Mouse Handler in your project, just add the following script reference to your project:

(-script src="https://mo-hi.github.io/mouseHandler/js/mouseHandler.js"-) (-/script-) | link

The application of mouseHandler via addEventListener in comparison with hover and Keyboard user inputs. When initializing the mouseHandler object, the function to be called on click is passed as a parameter. Two event listeners are added, one to check clickDown and on to check ClickUp. The assigned functions are always MH.MouseDown and MH.MouseUp. The hover event is added natively to the divs. The key event is added to the window.


See the result and notice when clicks that take longer than 300ms do not trigger the Click function:

Keyboard:
Click:
Hover:

{{no}}

{{id-end-index}}