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

Notification

Icon
Error

Options
Go to last post Go to first unread
soooulp  
#1 Posted : Tuesday, May 11, 2021 12:30:58 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
I try to use holding the left button with a stroll to achieve a horizontal stroll, but it seems not possible to change the stroke button temporarily through I search for the information from the forum.

I set the right button+stroll to other actions in the browser.

I have no good idea to achieve a horizontal stroll. Please give me some suggestions.

The following code to stroll horizontally seems not convenient. The navigation bar moves to the left when I stroll down, it moves to the right when strolling up, and it may be better if change the direction.

Code:

sp.MouseWheel(wheel.Point, true, wheel.Delta); 


soooulp  
#2 Posted : Tuesday, May 11, 2021 12:58:18 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
I find to hold a key like SPACE+stroll can achieve it, but it is not a perfect way for I need to press the key on the keyboard.

If you have a better way, please to tell me.

Code:
var mouseLocation = sp.GetCurrentMousePoint();
var currentScreen = Screen.FromPoint(mouseLocation);
if(mouseLocation.Y >= currentScreen.Bounds.Bottom - 40) {
    if(wheel.Delta > 0) {

    } else {

    }
} else if(mouseLocation.Y <= currentScreen.Bounds.Top + 35) {

   if(wheel.Delta > 0) {

    } else {

    }

} else if(mouseLocation.X <= currentScreen.Bounds.Left + 20) {
    if(wheel.Delta > 0){
       
    } else {
        
    }
} else if(mouseLocation.X >= currentScreen.Bounds.Right - 25) {
    if(wheel.Delta > 0) {

    } else {
    
    }
} else {
    //Default, pass mouse wheel message onto the original control

    var isSpaceDown = sp.GetKeyState(vk.SPACE) & 0x8000
    if(isSpaceDown) {
        //horizontal stroll
       sp.MouseWheel(wheel.Point, true, wheel.Delta); 
    } else {
        //vertical stroll
       sp.MouseWheel(wheel.Point, false, wheel.Delta); 
    }
}

Rob  
#3 Posted : Tuesday, May 11, 2021 1:38:55 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)
Quote:
it seems not possible to change the stroke button temporarily through I search for the information from the forum.

Code:
//Change Stroke button
sp_config.StrokeButton = MouseButtons.Right;

//Change secondary stroke button
sp_config.SecondaryStrokeButton = MouseButtons.Left;

Can specify Left, Middle, Right, X1, or X2 - the change happens immediately.

Does that help?

soooulp  
#4 Posted : Tuesday, May 11, 2021 2:09:18 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
Originally Posted by: Rob Go to Quoted Post
Quote:
it seems not possible to change the stroke button temporarily through I search for the information from the forum.

Code:
//Change Stroke button
sp_config.StrokeButton = MouseButtons.Right;

//Change secondary stroke button
sp_config.SecondaryStrokeButton = MouseButtons.Left;

Can specify Left, Middle, Right, X1, or X2 - the change happens immediately.

Does that help?




Emmm, I get it, it seems that it is better to change the stroke in a specific program.

I just want to horizontal stroll when the mouse is in the horizontal area, so as the vertical stroll.

Thanks, Rob. Never mind it, it rarely happens and I change to the normal way.

But can the navigation bar moves to the right when I stroll down and moves left when strolling up?













Rob  
#5 Posted : Tuesday, May 11, 2021 2:20:54 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)
Quote:
But can the navigation bar moves to the right when I stroll down and moves left when strolling up?

This will be very difficult to accomplish, with native controls (like Notepad), you can capture the mouse and use WM_NCHITTEST to detect if the mouse is above a horizontal scroll (HTHSCROLL).

But for non-native controls (like Chrome), this likely will not work.
soooulp  
#6 Posted : Tuesday, May 11, 2021 2:41:40 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
Originally Posted by: Rob Go to Quoted Post
Quote:
But can the navigation bar moves to the right when I stroll down and moves left when strolling up?

This will be very difficult to accomplish, with native controls (like Notepad), you can capture the mouse and use WM_NCHITTEST to detect if the mouse is above a horizontal scroll (HTHSCROLL).

But for non-native controls (like Chrome), this likely will not work.


It is such a confusing thing, and I can define it as one of the strange behaviors of Microsoft on Win10 now.

At the same time, it is interesting for the native controls, for this is common on Mac OS.

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.