How to make Middle Click Continuous Scroll for Notepad++
-
- Posts: 3
- Joined: 28 Nov 2013, 11:46
How to make Middle Click Continuous Scroll for Notepad++
In Browsers when we do middle Click and without releasing move down ill scroll continuously the contents down with some pace. Is there a way I can implement that in other applications like notepad++, windows explorer etc .
- emmanuel d
- Posts: 90
- Joined: 17 Nov 2013, 04:45
Re: How to make Middle Click Continuous Scroll for Notepad++
with a hotkey
a
and a
and a
folow the links, learn, and post the results
Code: Select all
#IfWinActive,ahk_exe Notepad++.exe
mbutton::
Code: Select all
while GetKeyState(KeyName [, "P" or "T"])
Code: Select all
sendinput
Code: Select all
sleep
-
- Posts: 3
- Joined: 28 Nov 2013, 11:46
Re: How to make Middle Click Continuous Scroll for Notepad++
Thanks , Scrolling is working perfectly fine , might not be as perfect as browser Continuous scroll though . One more thing i'm current doing paste for middle double click , so after this script paste is not working , Any idea how to detect middle double click in below code n do paste action instead ?
Code: Select all
#IfWinActive,ahk_exe Notepad++.exe
~mbutton::
MouseGetPos, orginalX, originalY
while GetKeyState("MButton",[ "P" or "T"])
{
MouseGetPos, curX, curY
if ( curY < originalY){
SendInput, {WheelUp 8}
} else {
SendInput, {WheelDown 8}
}
Sleep 200
}
#IfWinActive
- emmanuel d
- Posts: 90
- Joined: 17 Nov 2013, 04:45
Re: How to make Middle Click Continuous Scroll for Notepad++
Something in the way of:
Ps it schould be
Code: Select all
if (A_ThisHotkey=A_PriorHotkey and A_TimeSincePriorHotkey>200)
msgbox,doubleclicked
Code: Select all
while GetKeyState("MButton", "P")
- emmanuel d
- Posts: 90
- Joined: 17 Nov 2013, 04:45
Re: How to make Middle Click Continuous Scroll for Notepad++
Untested, i have no midlebutton
Code: Select all
#IfWinActive,ahk_exe Notepad++.exe
~mbutton::
if (A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200) { ; if doubleclick
SendInput,^v ; paste
Return ; exit the sub
}
MouseGetPos, orginalX, originalY
while GetKeyState("MButton","P") {
MouseGetPos, curX, curY
if ( curY < originalY)
SendInput, {WheelUp 8}
else SendInput, {WheelDown 8}
Sleep 200
}
Return ; you need a return at the end a sub
#IfWinActive
Re: How to make Middle Click Continuous Scroll for Notepad++
Hi,
I've modified gopikrish2000's script to include more fluid scrolling dependent on cursor vertical deviation from the point of initial middle-click position. Also, there is an image file (25x25 pixels) which shows up while middle button is pressed. The image file should be copied to the same folder as the script file, and is available at:
https://onedrive.live.com/redir?resid=C ... hoto%2cgif
The script looks like:
Please note that there are some hardcoded stuff in here, e.g. I named the script file "notepad++.ahk" and that's the window title which is matched in WinSet and WinMove commands. Furthermore, you might need to modify the region parameters in "WinSet, Region, 3-26 W25 H25, notepad++.ahk" line which clears off the image window borders.
Regards,
bperkic
I've modified gopikrish2000's script to include more fluid scrolling dependent on cursor vertical deviation from the point of initial middle-click position. Also, there is an image file (25x25 pixels) which shows up while middle button is pressed. The image file should be copied to the same folder as the script file, and is available at:
https://onedrive.live.com/redir?resid=C ... hoto%2cgif
The script looks like:
Code: Select all
#IfWinActive,ahk_exe Notepad++.exe
~mbutton::
CoordMode, Mouse, Screen
MouseGetPos, originalX, originalY, ActiveWin
imageX := originalX - 25
imageY := originalY - 50
SplashImage, image.gif
WinSet, TransColor, White, notepad++.ahk
WinSet, Region, 3-26 W25 H25, notepad++.ahk
WinMove, notepad++.ahk, , %imageX%, %imageY%
while GetKeyState("MButton", "P")
{
MouseGetPos, curX, curY
if ( curY < originalY){
diffY := (originalY - curY) / 25
moveY := Round(diffY)
SendInput, {WheelUp %moveY%}
} else {
diffY := (curY - originalY) / 25
moveY := Round(diffY)
SendInput, {WheelDown %moveY%}
}
Sleep 50
}
SplashImage, Off
#IfWinActive
Regards,
bperkic
Re: How to make Middle Click Continuous Scroll for Notepad++
I hadn't seen yours, above, but I made one that's vastly different, yet allows for larger amounts of acceleration and a couple other benefits by using postmessage. This does mean you need the control that responds to mousewheel for the program, but if you have that then it's fine. By default it works for Notepad++ and WinFlex
I also put a tiny gui with a double arrow symbol about where you click (if you move it to under the exact mouse point then it doesn't work for some reason).
I also put a tiny gui with a double arrow symbol about where you click (if you move it to under the exact mouse point then it doesn't work for some reason).
Code: Select all
#If WinActive("ahk_exe Notepad++.exe") ; Programs that respond to mouse wheel but not middle mouse button
~$mbutton::
#If WinActive("ahk_exe WinFlex6.exe") ; Programs that respond to middle button but you want more control
mbutton::
Acceleration = 4
SleepMod = 1
MouseGetPos, originalX, originalY, point_id, point_control
If WinActive("ahk_exe Notepad++.exe") ; Programs that respond to mouse wheel but not middle mouse button
If (point_control != "Scintilla1")
Exit
Else If WinActive("ahk_exe WinFlex6.exe") ; Programs that respond to middle button but you want more control
If (point_control != "Ter32Class1" || "SysTabControl321")
Exit
If (point_control == "SysTabControl321")
point_control := "Ter32Class1" ; control that responds to mousewheel
xGui := originalX - 31
yGui := originalY - 22
Gui -Caption +ToolWindow
Gui, Add, Text,, ↕ ; alternate symbols - ⇕ , ↕ , ↨ , ♦ , ♢
Gui, Show, NoActivate x%xGui% y%yGui%, New Title
while GetKeyState("MButton","P") {
MouseGetPos, curX, curY
VertDifference := originalY - curY
Movement := VertDifference
LoopAmount := abs(Movement / (1000/Acceleration))
If (LoopAmount < 1)
LoopAmount = 1
SleepTime := round(1 / abs(VertDifference * (1000/SleepMod)))
If (abs(Movement) > 0)
Loop %LoopAmount% {
PostMessage 0x20A, Movement<<16, (originalY<<16)|originalX, %point_control%, ahk_id %point_id% ; shifts Movement 16bits and sends to control
}
If (SleepTime > 0)
Sleep %SleepTime%
Else
Sleep 20
}
Gui, Destroy
Return
#If
Re: How to make Middle Click Continuous Scroll for Notepad++
Inserio, this code works great!
One question: is there a way to modify it so that one click on the mouse button initiates scrolling, rather than continuous press?
One question: is there a way to modify it so that one click on the mouse button initiates scrolling, rather than continuous press?
Re: How to make Middle Click Continuous Scroll for Notepad++
Inserio's script doesn't work on second monitor unlike Guest/bperkic's script. It would be great if someone modified the first one to work on multi-monitor setup.