Rank: Member
Groups: Approved
Joined: 7/4/2019(UTC) Posts: 24 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));
}
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 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.
|
1 user thanked Rob for this useful post.
|
|
|
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close