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

Notification

Icon
Error

Options
Go to last post Go to first unread
Strobiker  
#1 Posted : Wednesday, October 16, 2019 7:04:57 PM(UTC)
Strobiker

Rank: Member

Reputation:

Groups: Approved
Joined: 10/15/2019(UTC)
Posts: 10

Thanks: 2 times
Hi Rob,
in the old version I had a script that let me browse through Chrome tabs by hovering the mouse on top of the page and scrolling the mouse wheel.
I'd love to have that back.
Best,
Felix
Rob  
#2 Posted : Wednesday, October 16, 2019 7:24:05 PM(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)
Strobiker  
#3 Posted : Wednesday, October 16, 2019 7:46:00 PM(UTC)
Strobiker

Rank: Member

Reputation:

Groups: Approved
Joined: 10/15/2019(UTC)
Posts: 10

Thanks: 2 times
AMAZING.

You made my day. Thanks.
Strobiker  
#4 Posted : Saturday, October 19, 2019 7:37:00 PM(UTC)
Strobiker

Rank: Member

Reputation:

Groups: Approved
Joined: 10/15/2019(UTC)
Posts: 10

Thanks: 2 times
I tried adding Firefox because I sometimes switch browsers.

But this messes up the Chrome functionality. It suddenly decreases font size (zoom) in Chrome.

Any idea why?

Quote:
//This is a script I use, but figured I'd leave it for example purposes

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));
}

if(wheel.Window.Process.MainModule.ModuleName == "firefox.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 == "firefox.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  
#5 Posted : Sunday, October 20, 2019 1:45:51 PM(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)
Try this script instead. Your script shouldn't have caused that issue, but it also would've never reached the firefox code either:

Code:
if(wheel.Window.Title.indexOf("- Google Chrome") > -1 
    || wheel.Window.Title.indexOf("- Mozilla Firefox") > -1
    || wheel.Window.Title.indexOf("- Notepad++") > -1
    ) {
    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, change to next tab
            sp.SendKeys("^{TAB}");
        } else {
            //mouse wheel scrolled down, change to previous tab
            //This isn't support by Firefox, so nothing will happen
            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 down, send CTRL+End to go to the end of the page
            sp.SendKeys("^{END}");
        }
    } else if((wheel.Window.Title.indexOf("- Google Chrome") > -1 
                     || wheel.Window.Title.indexOf("- Mozilla Firefox") > -1
                    )
                   && wheel.X <= (parseInt(wheel.Window.Rectangle.Left) + 20)) {
        //is the mouse along the left side of the window?
        if(wheel.Delta > 0){
            //scroll up, send F5 to refresh the page
            sp.SendKeys("{F5}");
        } else {
            //scroll down, Browser Back to navigate to the last page
            sp.SendVKey(vk.BROWSER_BACK);
        }
    } else {
        sp.MouseWheel(wheel.Point, false, wheel.Delta);
    }
} else {
    sp.MouseWheel(wheel.Point, false, wheel.Delta);
}
thanks 1 user thanked Rob for this useful post.
Strobiker on 10/20/2019(UTC)
Strobiker  
#6 Posted : Sunday, October 20, 2019 7:21:38 PM(UTC)
Strobiker

Rank: Member

Reputation:

Groups: Approved
Joined: 10/15/2019(UTC)
Posts: 10

Thanks: 2 times
Works great. I just had to switch scroll up/down for my taste.

Thanks for you help!
2014218866  
#7 Posted : Friday, October 25, 2019 4:05:14 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Dear Rob, I want to ask you a question. When I apply the above wheel script, can I add the following function?
When the mouse is at the right edge of the window, it only executes the S+ script (return to the top) without performing the normal scrolling function that the mouse comes with (page up).
In other areas, the mouse performs the normal scrolling function, and this function is not S+ executed because it has obvious delay. Looking forward to your reply.
Rob  
#8 Posted : Friday, October 25, 2019 1:40:43 PM(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)
I'm not sure I am following you. This script has the right edge Control+Home functionality.

Though, the way the script is written, it is only executing that function for Chrome/Firefox/Notepad++.

Is that your question, that you want it to do that for all applications?
2014218866  
#9 Posted : Monday, October 28, 2019 12:06:27 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Dear Rob, I know my problem, but the delay of the scroll wheel caused by the application of this script can be solved? When I scroll the wheel, the screen sometimes scrolls after a few seconds.
By the way, can S+ achieve the following functions? When you draw a gesture in word, S+ will start the task manager and then select "WINWORD.EXE" in the process (not in the application). And I hope this feature also works for other windows. Thank you
Rob  
#10 Posted : Monday, October 28, 2019 2:15:30 PM(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)
The scrolling script can definitely be an issue, due to each mouse wheel tick having to execute a script separately.

I will get back to you, I'm aware of this and it's noted in the Known Issues. I'm going to think about ways to improve this, but it's a difficult situation to handle it in a flexible way.

Regarding the Task Manager question, it looks like the Details tab is using a ListView, so you should be able to accomplish this via windows messaging (API), but it will require code outside of a script. I have similar code to get the selected files on the desktop. I will look into this and let you know. I think making a plug-in to work with ListViews would be the best approach for this, but it will take me some time to work on that.
2014218866  
#11 Posted : Monday, October 28, 2019 11:59:08 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Thank you for your reply, Rob. Yes, if the wheel is used as a secondary button in the global gesture, then this gesture will be interfered with by the script executed by the scroll wheel.
Rob  
#12 Posted : Sunday, November 10, 2019 6:52:37 PM(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)
FYI, I added mouse hook exclusion zones in 0.3.5.1,

See here for details: https://forum.strokesplus.net/posts/m9817-Mouse-Hook-Exclusion-Zones
2014218866  
#13 Posted : Monday, November 11, 2019 11:40:56 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Dear rob, thank you for your hard work. It's a good function, but in my script, I don't know how to turn the area where "sp.mousewheel (wheel. Point, false, wheel. Delta)" is located into this exclusion zone, which is difficult for me.


var exeName = wheel.Window.Process.MainModule.ModuleName;

//is the mouse along the right side of the window?

if(wheel.X >= (parseInt(wheel.Window.Rectangle.Right) - 30)) {
wheel.Window.BringToFront();
if(wheel.Delta > 0){//滚轮向上
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {//上1/2窗口
ScreenBrightness.Adjust("1+")}
else if(wheel.Y >= parseInt(wheel.Window.Screen.WorkingArea.Height *19/20)) {//下1/20窗口
sp.SendVKey(vk.VOLUME_MUTE)}
else{//下1/2窗口
sp.SendVKey(vk.VOLUME_UP)}
}else{//滚轮向下
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {
ScreenBrightness.Adjust("20-") }
else if(wheel.Y >= parseInt(wheel.Window.Screen.WorkingArea.Height *19/20)) {
sp.SendVKey(vk.VOLUME_MUTE)}
else{
sp.SendVKey(vk.VOLUME_DOWN)}
}
}else if(wheel.X >= (parseInt(wheel.Window.Rectangle.Right) - 80)) {
wheel.Window.BringToFront();
if( wheel.Delta > 0){
if(exeName == "Acrobat.exe" ){
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {
//查找上一个
sp.SendKeys("^+g")}
else{
sp.SendModifiedVKeys([vk.LMENU], [vk.LEFT])}}
else if(exeName == "WINWORD.EXE" ){
//查找上一个
sp.SendModifiedVKeys([vk.LCONTROL], [vk.PRIOR])}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta)}
}else{ //滚轮向下
if(exeName == "Acrobat.exe" ){
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {
//查找上一个
sp.SendKeys("^g")}
else{
sp.SendModifiedVKeys([vk.LMENU], [vk.RIGHT])}}
else if(exeName == "WINWORD.EXE" ){
//查找上一个
sp.SendModifiedVKeys([vk.LCONTROL], [vk.NEXT])}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta)}
}
}
//is the mouse along the left side of the window?


else if(wheel.X <= (parseInt(wheel.Window.Rectangle.Left) + 30)) {
wheel.Window.BringToFront();
if(wheel.Delta > 0){
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {
sp.SendModifiedVKeys([vk.LCONTROL], [vk.HOME]);
}else{
sp.SendControlDown();
sp.MouseWheel(wheel.Point, false, +120);
sp.SendControlUp()}
}else{
if(wheel.Y <= parseInt(wheel.Window.Screen.WorkingArea.Height *1/2)) {
sp.SendModifiedVKeys([vk.LCONTROL], [vk.END])
}else{
sp.SendControlDown();
sp.MouseWheel(wheel.Point, false, -120);
sp.SendControlUp()
}
}
}
//is the mouse along the Top side of the window?


else if(parseInt(wheel.Y) <= (parseInt(wheel.Window.Rectangle.Top) + 170)){
wheel.Window.BringToFront();
if(wheel.Delta > 0){
if ( exeName == "WINWORD.EXE"||exeName == "Acrobat.exe"||exeName =="MindManager.exe"){
sp.SendKeys("^z")}
else if ( exeName == "chrome.exe"){
sp.SendKeys("^+{TAB}")}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta);}
}else{
if(exeName == "WINWORD.EXE"||exeName =="MindManager.exe"){
sp.SendKeys("^y")}
else if ( exeName == "Acrobat.exe"){
sp.SendKeys("^+z")}
else if ( exeName == "chrome.exe"){
sp.SendKeys("^{TAB}")}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta)}
}
}
//is the mouse along the Bottom side of the window?

else if(parseInt(wheel.Y) >= (parseInt(wheel.Window.Rectangle.Bottom) - 30)) {
wheel.Window.BringToFront();
if(wheel.Delta > 0) {
if ( exeName == "StormPlayer.exe"){
sp.SendKeys("{left}")}
else if ( exeName == "Acrobat.exe"){
sp.SendModifiedVKeys([vk.LCONTROL], [vk.ADD])}
else{
sp.SendControlDown();
sp.MouseWheel(wheel.Point, false, +120);
sp.SendControlUp()
}
}else{
if ( exeName == "StormPlayer.exe"){
sp.SendKeys("{right}")}
else if ( exeName == "Acrobat.exe"){
sp.SendModifiedVKeys([vk.LCONTROL], [vk.SUBTRACT])}
else{
sp.SendControlDown();
sp.MouseWheel(wheel.Point, false, -120);
sp.SendControlUp()}
}
}
//is the mouse along the Bottom side of the window?

else if(parseInt(wheel.Y) >= parseInt(wheel.Window.Screen.WorkingArea.Height *2/3)) {//下1/3窗口
wheel.Window.BringToFront();
if(wheel.Delta > 0) {
if ( exeName == "StormPlayer.exe"){
sp.SendKeys("{left}")}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta);
}
}else{
if ( exeName == "StormPlayer.exe"){
sp.SendKeys("{right}")}
else{
sp.MouseWheel(wheel.Point, false, wheel.Delta)}
}
}
//is the mouse along the other area of the window?

else{
sp.MouseWheel(wheel.Point, false, wheel.Delta);
}
Rob  
#14 Posted : Monday, November 11, 2019 4:34:35 PM(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)
The script will never be executed if the mouse is in an exclusion zone.

The script ONLY executes if the mouse is NOT in an exclusion zone.

Oh, do you mean you want to create the exclusion zones based on the areas defined in this script? If so, looking at your script, it seems you need these exclusion areas:

  • right edge 80 px
  • left edge 30 px
  • top edge 170px
  • bottom edge 1/3 of screen


This script will set those areas:

Code:
//This clears all exclusion zones - it is not necessary to call
//Just make sure you're not unintentionally adding multiple extra 
//exclusion zones which you're testing this script.
sp_config.MouseHookExclusionZones.Clear();

//Get all screens
var allScreens = Screen.AllScreens;

//Loop through all screens, setting the exclusion area
for(var i = 0; i < allScreens.Length; i++) {

    //Get the working area rectangle of the screen
    var rect = allScreens[i].WorkingArea;

    //Left side
    var exclZoneLeft = new MouseHookExclusionZone();
    exclZoneLeft.Rectangle = new Rectangle(rect.Left, rect.Top, 30, rect.Height);

    //This exclusion area only affects mouse wheel scroll events, not the stroke buttons
    exclZoneLeft.HorizontalMouseWheelScroll = true;
    exclZoneLeft.VerticalMouseWheelScroll = true;

    exclZoneLeft.PrimaryStrokeButton = false;
    exclZoneLeft.SecondaryStrokeButton = false;

    exclZoneLeft.Active = true;
    //Add the exclusion zone to S+ settings
    sp_config.MouseHookExclusionZones.Add(exclZoneLeft);

    //Right side
    var exclZoneRight = new MouseHookExclusionZone();
    exclZoneRight.Rectangle = new Rectangle(rect.Right - 80, rect.Top, 80, rect.Height);
    
    //This exclusion area only affects mouse wheel scroll events, not the stroke buttons
    exclZoneRight.HorizontalMouseWheelScroll = true;
    exclZoneRight.VerticalMouseWheelScroll = true;

    exclZoneRight.PrimaryStrokeButton = false;
    exclZoneRight.SecondaryStrokeButton = false;

    exclZoneRight.Active = true;
    //Add the exclusion zone to S+ settings
    sp_config.MouseHookExclusionZones.Add(exclZoneRight);

    //Along top
    var exclZoneTop = new MouseHookExclusionZone();
    exclZoneTop.Rectangle = new Rectangle(rect.Left, rect.Top, rect.Width, 170);

    //This exclusion area only affects mouse wheel scroll events, not the stroke buttons
    exclZoneTop.HorizontalMouseWheelScroll = true;
    exclZoneTop.VerticalMouseWheelScroll = true;

    exclZoneTop.PrimaryStrokeButton = false;
    exclZoneTop.SecondaryStrokeButton = false;

    exclZoneTop.Active = true;
    //Add the exclusion zone to S+ settings
    sp_config.MouseHookExclusionZones.Add(exclZoneTop);

    //Along bottom
    var exclZoneBottom = new MouseHookExclusionZone();
    exclZoneBottom.Rectangle = new Rectangle(rect.Left, parseInt(rect.Height * 0.66), rect.Width, parseInt(rect.Height - (rect.Height * 0.66)));
  
    //This exclusion area only affects mouse wheel scroll events, not the stroke buttons
    exclZoneBottom.HorizontalMouseWheelScroll = true;
    exclZoneBottom.VerticalMouseWheelScroll = true;

    exclZoneBottom.PrimaryStrokeButton = false;
    exclZoneBottom.SecondaryStrokeButton = false;

    exclZoneBottom.Active = true;
    //Add the exclusion zone to S+ settings
    sp_config.MouseHookExclusionZones.Add(exclZoneBottom);
}

//Save S+.net settings
sp_config.Save();

Edited by user Monday, November 11, 2019 4:36:41 PM(UTC)  | Reason: Not specified

2014218866  
#15 Posted : Tuesday, November 12, 2019 1:38:52 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Thank you for your reply, rob
Maybe I didn't express my problem clearly. These four areas are my script execution areas,

right edge 80 px
left edge 30 px
top edge 170px
bottom edge 1/3 of screen

And other areas are my exclusion areas.
Rob  
#16 Posted : Tuesday, November 12, 2019 4:49:01 PM(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)
Oh yes, you're right - I gave you the opposite!

This would create a mouse wheel exclusion zone inside the middle of those areas.

Code:
sp_config.MouseHookExclusionZones.Clear();

var allScreens = Screen.AllScreens;

for(var i = 0; i < allScreens.Length; i++) {
    var rect = allScreens[i].WorkingArea;

    //Exclude all but the screen edges, for a mouse wheel script to not 
    //execute in the main area of the screen
    //This only affects mouse wheel scroll events, does not exclude stroke button events
    var exclZoneCenter = new MouseHookExclusionZone();
    exclZoneCenter.Rectangle = new Rectangle(rect.Left + 30, rect.Top + 170, rect.Width - 150, parseInt(rect.Height * 0.66) - 170);
    exclZoneCenter.HorizontalMouseWheelScroll = true;
    exclZoneCenter.VerticalMouseWheelScroll = true;
    exclZoneCenter.PrimaryStrokeButton = false;
    exclZoneCenter.SecondaryStrokeButton = false;
    exclZoneCenter.Active = true;
    sp_config.MouseHookExclusionZones.Add(exclZoneCenter);

}

sp_config.Save();
2014218866  
#17 Posted : Friday, November 15, 2019 7:58:15 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Dear Rob, I found three problems:
1) Enabling the mouse wheel script always automatically cancels the previous check;
2) The window below the activation mouse wheel is invalid;
3) S-plus sometimes pops up: no script available.

[img=https://sm.ms/image/FWKhBQ2gcZCmwGJ]1[/img]

[img=https://sm.ms/image/Jzbn2aK7tvjE6xh]2[/img]
Rob  
#18 Posted : Friday, November 15, 2019 8:38:19 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)
1) Can you please explain this in more detail? I do not understand, can you provide steps to reproduce that I can follow to see what you mean?

2) That setting will only work outside of exclusion zones. The exclusion zones tell S+ to not interfere with any related mouse events within the exclusion zones. For example, if you scroll in the bottom 1/3 of the screen it should work - anywhere a mouse wheel script would execute, the window should be activated. I will add an option in the next release to allow the window activation to function even if inside an exclusion zone.

3) You might try increasing this setting so S+ waits longer for the previous scripts to finish
https://www.strokesplus.net/images/ScriptEngineLocks.jpg
2014218866  
#19 Posted : Friday, November 15, 2019 10:04:59 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Well, sometimes, my wheel script doesn't work. When I turned on the S-plus settings, I found that the wheel script was not enabled (as shown in the picture),
but this was the option that the S-plus automatically turned off, and it was not my own manual setup to cancel the wheel script.
Dear Rob, perhaps, you can reproduce this phenomenon by using wheel scripts frequently.

UserPostedImage
thanks 1 user thanked 2014218866 for this useful post.
soooulp on 4/24/2020(UTC)
Rob  
#20 Posted : Friday, November 15, 2019 9:23:07 PM(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)
If you check the Replay Mouse Wheel Events option, it will disable the Mouse Wheel scripts, because they're not compatible together. Also, that option is for older versions of Windows anyway, so it's not really needed much anymore.

Also, in version 0.3.5.3 you can now manage the exclusion zones in the Options screen.
2014218866  
#21 Posted : Saturday, November 16, 2019 10:38:15 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Maybe I need to make a choice between the two. In addition, I feed back a problem of the latest version of S +.
Through the previous exclusion area script, I can execute the scroll script on the edge of any size window, but in the latest version of S + (0.3.5.4),
the exclusion area is only for the edge of the computer screen, not the edge of the program window. In other words, when my program window is not maximized, the scroll script will not work at the edge of the program (because it is in the excluded area when window is maximized. ).
Finally, thank you for your work on my requirements. Thank you, Rob.
Rob  
#22 Posted : Sunday, November 17, 2019 3:24:33 PM(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)
I've added the option to make an exclusion zone be relative to the window in 0.3.5.5.

So the exclusion area will be adjusted to the window's size first. Hopefully that will work for your needs, because I am done with these exclusion zones for a while BigGrin

I created this one to test and it worked for me. Note that the borders size scale with the window size, so the top border won't be 130 on a window that isn't maximized, the top border will be scaled down to an approximate percentage of the full size - basically everything gets a little smaller, or a lot smaller if the window is very small.

Though you can set to not scale the top and left, which will always position the rectangle at that location, but then the right and bottom could be off due to scaling. However, you could also update your scroll script to use relative distance checks too, so instead checking right - 30px, you could make it a percentage of the window's size so it would function properly with the exclusion zone scaling. I'm sure you'd have to tweak it to be just right, but there's no reason it couldn't work.

https://www.strokesplus.net/images/WheelExclusionArea.png

Edited by user Sunday, November 17, 2019 3:32:56 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
2014218866 on 11/18/2019(UTC)
2014218866  
#23 Posted : Monday, November 18, 2019 12:25:54 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Yes, it's easy to use, but how can I make s + fix the width of the surrounding edges instead of scaling to a certain scale according to the window changes?
Rob  
#24 Posted : Monday, November 18, 2019 3:12:12 PM(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)
Okay, this is the LAST change I am making for these exclusion zones!! BigGrin

You can now pick Fixed Edge which maintains the selected outside edges' distances and scales the inside. Note that this can result in an empty rectangle if the window rectangle is smaller than the resulting rectangle after the border edges are applied. Note that the relative calculations do not factor the taskbar size/area, so you may need to increase the height of the zone by the height of the taskbar if this is a problem for you.

This is the setup for your original exclusion area, note this is for a 1920 x 1080 screen.

https://www.strokesplus.net//images/WheelZoneFixedBorders.png


This is a script I made to test out showing the size of the calculated rectangle, as it may be useful.

Code:
var exclZoneName = "Wheel Area Relative"; //CHANGE to the correct exclusion zone name
var exclZone = sp_config.MouseHookExclusionZones.Where(a => a.Description == exclZoneName).FirstOrDefault();
if(exclZone != null) {
    var targetRect = exclZone.Relative ? exclZone.GetRelativeRectangle(Screen.FromPoint(exclZone.Rectangle.Location).Bounds, Screen.FromPoint(action.Start).Bounds, action.Window.FrameRectangle) : exclZone.Rectangle;
    if(targetRect.Width > 0 && targetRect.Height > 0) {
        var previousImageWindow = sp.WindowFromClassOrTitle("", "StrokesPlus.net Display Image Window");
        if(previousImageWindow != null) {
            previousImageWindow.SendClose();
        }
        var memoryImage = new drawing.System.Drawing.Bitmap(targetRect.Width, targetRect.Height);
        var memoryGraphics = drawing.System.Drawing.Graphics.FromImage(memoryImage);
        clip.SetImage(memoryImage);
        memoryGraphics.Dispose();
        memoryImage.Dispose();
        sp.DisplayImage(clip.GetImage());
        sp.Sleep(200);
        sp.WindowFromClassOrTitle("", "StrokesPlus.net Display Image Window").Location = new Point(targetRect.X, targetRect.Y);
    } else {
        sp.MessageBox("Empty Rectangle, nothing to show", "Empty Rectangle");
    }
}

Edited by user Monday, November 18, 2019 3:50:27 PM(UTC)  | Reason: Fixed script to work for relative or non-relative zones

2014218866  
#25 Posted : Tuesday, November 19, 2019 2:57:43 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Thank you again for your efforts in my request, Rob.
liuxilu  
#26 Posted : Tuesday, April 7, 2020 10:21:51 AM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/6/2020(UTC)
Posts: 79
China

Thanks: 1 times
Was thanked: 21 time(s) in 21 post(s)
I'm sorry but, what's the different between 'fixed' and 'fixed edge'?

Take 'width' as the example:

  1. 'fixed' just means 'fixed from left edge': counts 'width' px from the left bound of window.
  2. 'fixed edge' just means 'fixed from right edge': counts screen width minus 'width' px from the right bound of window.

Is the understand above correct?
Rob  
#27 Posted : Friday, April 17, 2020 12:12:07 PM(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)
Right, fixed means literally a fixed rectangle, in position and size.

Fixed edge means the distance from the edge is fixed/scaled relatively.

Note that I have a pending fix which I still need to release

"- Fixed issue with Relative to Window Exclusion Zone type not working properly"
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.