js & listen mouse click
js & listen mouse click
how to listen mouse click in js
https://www.kirupa.com/html5/mouse_events_in_javascript.htm
document.addEventListener("mousedown", buttonPress, false);
function buttonPress(e) {
if (e.button == 0) {
console.log("Left mouse button pressed!");
} else if (e.button == 1) {
console.log("Middle mouse button pressed!");
} else if (e.button == 2) {
console.log("Right mouse button pressed!");
} else {
console.log("Things be crazy up in here!!!");
}
}
https://stackoverflow.com/questions/2405771/is-right-click-a-javascript-event
https://stackoverflow.com/questions/26267667/how-to-listen-for-a-mouse-click-in-a-javascript-game
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/10287784.html
未经授权禁止转载,违者必究!