Scrolling Horizontally With Mouse Button Like Holding The Shift
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Scrolling Horizontally With Mouse Button Like Holding The Shift
I want to use only mouse to scroll in pages, but whatever I do I can't make it work. I think mouse buttons behave differently than keyboard because in Keybaord a::b holds down b like it is a.
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
You can post your script below. What happens when you run your script? What should happen instead?
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
Script is this
Code: Select all
XButton2:: send, {Shift Down}
also i tried
Code: Select all
XButton2:: send, {Shift}
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
Confusing. Your goal is to use the mouse to scroll. Can you describe how scrolling would normally work for you? Does this have anything to do with pressing the Shift key?
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
Yes, scrolling usually is vertical in pages but in pages with high width, like a page that includes a table with a lot of columns one had to scroll in width of the page and that can be done either by using the scrollbar at the bottom of the page (which is very annoying to use) or holding the the shift key and using mouse while to scroll in it. You can test it right now just zoom in in this page using `Ctrl + =`.
P.S.
it is the same "Ctrl" . Ctrl + wheel up/down is changing global zoom on web-browsers. but it doen't work as i map Ctrl to a mouse button
full code again to maybe make things more clear.
Code: Select all
XButton2:: send, {Shift}
XButton1:: send, {Ctrl}
XButton1 & LButton:: send, ^{LButton}
P.S.2
Now I change the script totally, I is just that it ignores the second condition and changed zoom or scroll randomly whenever I press XButton1 or XButton2 without using wheel button.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
FileEncoding , UTF-8
#Persistent
Loop {
if (GetKeyState("XButton2","P") && GetKeyState("WheelDown","P")){
Send, +{WheelDown}
}
if (GetKeyState("XButton2","P") && GetKeyState("WheelUp","P")){
Send, +{WheelUp}
}
if (GetKeyState("XButton1","P") && GetKeyState("WheelDown","P")){
Send, ^{WheelDown}
}
if (GetKeyState("XButton1","P") && GetKeyState("WheelUp","P")){
Send, ^{WheelUp}
}
}
XButton2::
return
XButton1:: Send, {Ctrl}
XButton1 & LButton:: Send, ^{LButton}
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
How about:
Code: Select all
XButton2::Shift
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
that working like a charm, but one issue now is that i tried to do the same for control and that works for scrolling but now i want to be able Ctrl + Click with it on links and it doesn't work. And when i add another line to define xbutton1+click as control Click it doesn't work
Code: Select all
XButton2::Shift
XButton1::Control
; XButton1 & LButton:: Send, ^{LButton}
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
thank you , it works like a charm now . but the issue is that i can't do this and also combine it with another key, like i can use xbutton1 as control key but i can't control click with it and if i add an extra line (third line below) for control click the first mapping stops to work
Code: Select all
XButton2::Shift
XButton1::Control
; XButton1 & LButton:: Send, ^{LButton}
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
I tested with XButton1.
Code: Select all
XButton1::XButton1
XButton1 & LButton::Send ^{LButton}
#If GetKeyState("XButton1", "P")
WheelDown::WheelRight
WheelUp::WheelLeft
#If
-
- Posts: 25
- Joined: 06 May 2022, 03:16
-
- Posts: 25
- Joined: 06 May 2022, 03:16
Re: Scrolling Horizontally With Mouse Button Like Holding The Shift
This works , thank you very muchmikeyww wrote: ↑29 Jun 2022, 05:20I tested with XButton1.
Code: Select all
XButton1::XButton1 XButton1 & LButton::Send ^{LButton} #If GetKeyState("XButton1", "P") WheelDown::WheelRight WheelUp::WheelLeft #If