StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
kookob  
#1 Posted : Tuesday, March 10, 2020 3:22:00 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, when I enable the mouse wheel script.
And the script work well in chrome.
But when I press "win+v" and pop the windows internally clip history. the wheel can't work for me.
And I turn off this script. It works ok.
How to modify the last line script:
wheel.Control.PostMessage(host.cast(uint, 0x020A), new IntPtr(wheel.WParam), new IntPtr(wheel.LParam));


Code:

if(wheel.Window.Process.MainModule.ModuleName == "chrome.exe" || wheel.Window.Process.MainModule.ModuleName == "notepad++.exe") {
    if(parseInt(wheel.Y) <= (parseInt(wheel.Window.Rectangle.Top) + 64)) {//is the mouse in the top 64 pixel area of the window?
        if(wheel.Delta > 0) {
            //mouse wheel scrolled up
            sp.SendKeys("^+{TAB}");
        } else {
            //mouse wheel scrolled down
            sp.SendKeys("^{TAB}");
        }
    } else if(wheel.X >= (parseInt(wheel.Window.Rectangle.Right) - 25)) { //is the mouse along the right side of the window?
        if(wheel.Delta > 0) {
            //scroll up, send CTRL+Home to go to the top of the page
            sp.SendKeys("^{HOME}");
        } else {
            //scroll up, send CTRL+End to go to the end of the page
            sp.SendKeys("^{END}");
        }
    } else if(wheel.Window.Process.MainModule.ModuleName == "chrome.exe" && wheel.X <= (parseInt(wheel.Window.Rectangle.Left) + 20)) {
        if(wheel.Delta > 0){
            //scroll up, send CTRL+Home to go to the top of the page
            sp.SendKeys("{F5}");
        } else {
            //scroll up, send CTRL+End to go to the end of the page
            sp.SendVKey(vk.BROWSER_BACK);
        }
    } else {
        //Default, pass mouse wheel message onto the original control
        wheel.Control.PostMessage(host.cast(uint, 0x020A), new IntPtr(wheel.WParam), new IntPtr(wheel.LParam));
    }
} else {
    //Default, pass mouse wheel message onto the original control
    wheel.Control.PostMessage(host.cast(uint, 0x020A), new IntPtr(wheel.WParam), new IntPtr(wheel.LParam));
}
Rob  
#2 Posted : Tuesday, March 10, 2020 4:57:49 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Replace both of the PostMessage lines:
Code:
wheel.Control.PostMessage(host.cast(uint, 0x020A), new IntPtr(wheel.WParam), new IntPtr(wheel.LParam));


With this:
Code:
sp.MouseWheel(wheel.Point, false, wheel.Delta);


That original code is very old.
thanks 1 user thanked Rob for this useful post.
kookob on 3/10/2020(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.