Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; AutoHotkey Version: 1.x
- ; Language: English
- ; Platform: Win9x/NT
- ; Author: A.N.Other <myemail@nowhere.com>
- ;
- ; Script Function:
- ; Esc is right-click and F1 is click-to-scroll. F2 is now mapped as Esc
- ;
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- Esc::Rbutton
- F2::Esc
- $*f1::
- Hotkey, $*f1 Up, f1up, off
- ;KeyWait, f1, T0.4
- ;If ErrorLevel = 1
- ;{
- Hotkey, $*f1 Up, f1up, on
- MouseGetPos, ox, oy
- SetTimer, WatchTheMouse, 5
- movedx := 0
- movedy := 0
- pixelsMoved := 0
- ;}
- ;Else
- ; Send {f1}
- return
- f1up:
- Hotkey, $*f1 Up, f1up, off
- SetTimer, WatchTheMouse, off
- WatchTheMouse:
- MouseGetPos, nx, ny
- movedx := movedx+nx-ox
- movedy := movedy+ny-oy
- pixelsMoved := pixelsMoved + Abs(nx-ox) + Abs(ny-oy)
- timesX := Abs(movedx) / 1
- ControlGetFocus, control, A
- Loop, %timesX%
- {
- If (movedx > 0)
- {
- SendMessage, 0x114, 1, 0, %control%, A ; 0x114 is WM_HSCROLL
- movedx := movedx - 1
- }
- Else
- {
- SendMessage, 0x114, 0, 0, %control%, A ; 0x114 is WM_HSCROLL
- movedx := movedx + 1
- }
- }
- timesY := Abs(movedy) / 1
- Loop, %timesY%
- {
- If (movedy > 0)
- {
- Click WheelDown
- movedy := movedy - 1
- }
- Else
- {
- Click WheelUp
- movedy := movedy + 1
- }
- }
- MouseMove ox, oy
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement