Advertisement
Mangus875

Move Mouse with Arrow Keys

Feb 18th, 2025
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Requires AutoHotkey v2.0
  2. #SingleInstance
  3. A_HotkeyInterval := 0
  4.  
  5. def_sens := 1
  6. sens2 := 3
  7. sens := 0
  8. du := 0
  9. dl := 0
  10. dr := 0
  11. dd := 0
  12.  
  13. *RCtrl:: {
  14.     global
  15.     sens := sens2
  16. }
  17.  
  18. *RCtrl UP:: {
  19.     global
  20.     sens := def_sens
  21. }
  22.  
  23. *Up:: {
  24.     global
  25.     du := 1
  26. }
  27.  
  28. *Down:: {
  29.     global
  30.     dd := 1
  31. }
  32.  
  33. *Left:: {
  34.     global
  35.     dl := 1
  36. }
  37.  
  38. *Right:: {
  39.     global
  40.     dr := 1
  41. }
  42.  
  43. *Up UP:: {
  44.     global
  45.     du := 0
  46. }
  47.  
  48. *Down UP:: {
  49.     global
  50.     dd := 0
  51. }
  52.  
  53. *Left UP:: {
  54.     global
  55.     dl := 0
  56. }
  57.  
  58. *Right UP:: {
  59.     global
  60.     dr := 0
  61. }
  62.  
  63. #SuspendExempt
  64. #R:: {
  65.     reload
  66. }
  67.  
  68. SendMouse_RelativeMove(x, y) {
  69.     DllCall("mouse_event", "UInt", 0x01, "UInt", x, "UInt", y)
  70. }
  71.  
  72. SetTimer(mouseMoveLoop,1)
  73.  
  74. mouseMoveLoop() {
  75.     SendMouse_RelativeMove(sens*(dr-dl), sens*(dd-du))
  76. }
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement