cristianbuse / VBA-UserForm-MouseScroll

Use the Mouse Scroll Wheel to scroll VBA UserForms and Controls
MIT License
70 stars 12 forks source link

please add vertical scroll #9

Closed DeerSpotter closed 2 years ago

DeerSpotter commented 2 years ago

who need horizontal scroll?

That's not what is needed in VBA its vertical scroll.

DeerSpotter commented 2 years ago

your demo doesnt show any vertical scroll.

cristianbuse commented 2 years ago

@DeerSpotter The demo has vertical scroll by default. Horizontal scroll only works if the SHIFT key is down/pressed. I have tested on multiple machines and it works fine.

Please check if your SHIFT key is stuck or maybe try disconnecting the keyboard. Also, if you are using specialized mouse software like "X-Mouse Button Control" then turn it off and then try the demo again.

DeerSpotter commented 2 years ago

Another question, how can i disable shift key altogether and have it automatically hook on form initialize?

DeerSpotter commented 2 years ago

I'm now looking for a way to code in keyboard press shift down on form initialize and release shift on form close.

Unless you have a better idea.

cristianbuse commented 2 years ago

@DeerSpotter In the MouseScroll.bas module there is a function that returns the state of the SHIFT key. Try replacing:

Private Function IsShiftKeyDown() As Boolean
    Const VK_SHIFT As Long = &H10
    '
    IsShiftKeyDown = CBool(GetKeyState(VK_SHIFT) And &H8000) 'hi-order bit only
End Function

with:

Private Function IsShiftKeyDown() As Boolean
    IsShiftKeyDown = False
End Function

and then see if the vertical scroll works. Let me know how it goes

DeerSpotter commented 2 years ago

@DeerSpotter In the MouseScroll.bas module there is a function that returns the state of the SHIFT key. Try replacing:

Private Function IsShiftKeyDown() As Boolean
    Const VK_SHIFT As Long = &H10
    '
    IsShiftKeyDown = CBool(GetKeyState(VK_SHIFT) And &H8000) 'hi-order bit only
End Function

with:

Private Function IsShiftKeyDown() As Boolean
    IsShiftKeyDown = False
End Function

and then see if the vertical scroll works. Let me know how it goes

It still requires me to press shift to scroll. Even if i say = true still requires shift to be pressed.

cristianbuse commented 2 years ago

It still requires me to press shift to scroll. Even if i say = true still requires shift to be pressed.

@DeerSpotter At this stage, I am pretty certain that another software on your computer is hooking the mouse and not passing the information via CallNextHook. If you have any mouse software (like X-Mouse Button Control) just disable it and then try again

DeerSpotter commented 2 years ago

It still requires me to press shift to scroll. Even if i say = true still requires shift to be pressed.

@DeerSpotter At this stage, I am pretty certain that another software on your computer is hooking the mouse and not passing the information via CallNextHook. If you have any mouse software (like X-Mouse Button Control) just disable it and then try again

Okay its working, Thank you. That's what it was. Is there a way to make it work with X-Mouse Button Control?

DeerSpotter commented 2 years ago

would 3dConnection program also do the same thing as x-mouse button control?

cristianbuse commented 2 years ago

@DeerSpotter Maybe. Try closing it before trying the demo and see how it goes.

cristianbuse commented 11 months ago

Okay its working, Thank you. That's what it was. Is there a way to make it work with X-Mouse Button Control?

Yes. See this