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: 42
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

safalpiya
Posts: 17
Joined: 17 Oct 2018, 04:28

Re: Wheel mouse emulation for Subfile

Post by safalpiya » 03 May 2019, 01:37

Hi Hidekazu Tanaka,

Can we make this a global setting so that we don't have to add onArrive and onLeave on each screen that has subfile page up and down?

Regards,
Safal Piya
Regards,
Safal Piya

Fairdinkum
Posts: 42
Joined: 24 Jul 2017, 17:02

Re: Wheel mouse emulation for Subfile

Post by Fairdinkum » 20 May 2019, 16:00

Hi Safal,

Sorry for delay reply. You might have already tried, but it can be implemented by:
- Coding in onApplicationStart instead of onArrive
- Coding in onApplicationEnd instead of onLeave

In this case, wheel scrolling will be ALWAYS emulated as PageUp/Down on all the screens.

Hope this helps.

Best Regards,
Hidekazu Tanaka

Post Reply