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: 128
Joined: 24 Jul 2017, 17:02

Wheel mouse emulation for Subfile

Post by Fairdinkum »

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 »

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: 128
Joined: 24 Jul 2017, 17:02

Re: Wheel mouse emulation for Subfile

Post by Fairdinkum »

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
Joerg Hamacher
Posts: 40
Joined: 09 Mar 2016, 00:29

Re: Wheel mouse emulation for Subfile

Post by Joerg Hamacher »

Hi Hidekazu,
this is a great script.
My problem with it is that whenputting it into "onApplicationStart" it is active in the complete editor session, too.
Is there a way to re-define the script so it has only effect in the screen itself and not in the editor part?

Best regards and many thanks,
Joerg
Fairdinkum
Posts: 128
Joined: 24 Jul 2017, 17:02

Re: Wheel mouse emulation for Subfile

Post by Fairdinkum »

Hi Joerg,
Thanks for your kindly comment! It will probably be solved by my first post. It said coding into onArrive/onLeave properties. I'm not 100% sure what "it is active in the complete editor session" means, though, it would not happen if the screen is "locked".
HTH :)

Best Regards,
Hidekazu Tanaka
Post Reply