Wheel mouse emulation for Subfile

Use this Forum to post tips and techniques for using aXes. Please explain in detail. This Forum is managed by the aXes user community. LANSA cannot guarantee the accuracy of any information posted to this Forum.

Moderator: jeanmichel

Post Reply
Fairdinkum
Posts: 21
Joined: 24 Jul 2017, 17:02

Wheel mouse emulation for Subfile

Post by Fairdinkum » 28 May 2018, 18:01

Hi,

A mouse scroll event can be detected by easy customization/scripting.
Copy and paste the following codes into onArrive and onLeave properties.

(onArrive)
----------------------------------------------------------------------------
/*
* Firefox
*/
if(window.addEventListener){
window.addEventListener('DOMMouseScroll', function(e){
console.log("addEventListener (Firefox)");
console.log("[Firefox] "+e.detail);
if ( e.detail > 0 )
SENDKEY("PageUp");
else
SENDKEY("PageDown");
}, false);
}
/*
* Chrome/IE/Edge/Safari
*/
window.onmousewheel = function(e){
console.log("onmousewheel enabled (Chrome)");
console.log("[Chrome] "+e.wheelDelta);
if ( e.wheelDelta < 0 )
SENDKEY("PageDown");
else
SENDKEY("PageUp");
};
----------------------------------------------------------------------------

(onLeave)
----------------------------------------------------------------------------
/*
* Firefox
*/
if(window.removeEventListener){
window.addEventListener('DOMMouseScroll', function(e){
console.log("removeEventListener (Firefox)");
}, false);
}
/*
* Chrome/IE/Edge/Safari
*/
window.onmousewheel = function(e){
console.log("onmousewheel disabled (Chrome)");
};
----------------------------------------------------------------------------


The result will be:
https://drive.google.com/file/d/0BwvNUe ... Q4SWM/view

HTH.

Best Regards,
Hidekazu Tanaka

Post Reply