Advertisement
Guest User

Logitech One-Finger Scroll

a guest
Apr 18th, 2012
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. ;
  2. ; AutoHotkey Version: 1.x
  3. ; Language: English
  4. ; Platform: Win9x/NT
  5. ; Author: A.N.Other <myemail@nowhere.com>
  6. ;
  7. ; Script Function:
  8. ; Esc is right-click and F1 is click-to-scroll. F2 is now mapped as Esc
  9. ;
  10.  
  11. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  12. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  13. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  14.  
  15.  
  16. Esc::Rbutton
  17. F2::Esc
  18.  
  19. $*f1::
  20. Hotkey, $*f1 Up, f1up, off
  21. ;KeyWait, f1, T0.4
  22. ;If ErrorLevel = 1
  23. ;{
  24. Hotkey, $*f1 Up, f1up, on
  25. MouseGetPos, ox, oy
  26. SetTimer, WatchTheMouse, 5
  27. movedx := 0
  28. movedy := 0
  29. pixelsMoved := 0
  30. ;}
  31. ;Else
  32. ; Send {f1}
  33. return
  34.  
  35. f1up:
  36. Hotkey, $*f1 Up, f1up, off
  37. SetTimer, WatchTheMouse, off
  38. WatchTheMouse:
  39. MouseGetPos, nx, ny
  40. movedx := movedx+nx-ox
  41. movedy := movedy+ny-oy
  42.  
  43. pixelsMoved := pixelsMoved + Abs(nx-ox) + Abs(ny-oy)
  44.  
  45. timesX := Abs(movedx) / 1
  46. ControlGetFocus, control, A
  47. Loop, %timesX%
  48. {
  49. If (movedx > 0)
  50. {
  51. SendMessage, 0x114, 1, 0, %control%, A ; 0x114 is WM_HSCROLL
  52. movedx := movedx - 1
  53. }
  54. Else
  55. {
  56. SendMessage, 0x114, 0, 0, %control%, A ; 0x114 is WM_HSCROLL
  57. movedx := movedx + 1
  58. }
  59. }
  60.  
  61. timesY := Abs(movedy) / 1
  62. Loop, %timesY%
  63. {
  64. If (movedy > 0)
  65. {
  66. Click WheelDown
  67. movedy := movedy - 1
  68. }
  69. Else
  70. {
  71. Click WheelUp
  72. movedy := movedy + 1
  73. }
  74. }
  75.  
  76. MouseMove ox, oy
  77. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement