Advertisement
EzFlow997

Mouse Speed Changer V2

Mar 21st, 2025 (edited)
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 1.39 KB | Source Code | 0 0
  1. #Requires AutoHotkey v2.0
  2. #InputLevel 1
  3. #SingleInstance Force
  4. PID := DllCall("GetCurrentProcessId")
  5. ProcessSetPriority "High", PID
  6. A_HotkeyInterval := 0
  7.  
  8. NewMouseSpeeder := MouseSpeeder()
  9.  
  10. CapsLock::{
  11.     NewMouseSpeeder.updateMouseSpeed()
  12. }
  13.  
  14. ^i::{
  15.     NewMouseSpeeder.increaseMultiplier()
  16.     NewMouseSpeeder.showUpdate()
  17. }
  18.  
  19. ^d::{
  20.     NewMouseSpeeder.decreaseMultiplier()
  21.     NewMouseSpeeder.showUpdate()
  22. }
  23.  
  24. +CapsLock:: Reload
  25.  
  26. ^CapsLock:: ExitApp
  27.  
  28. class MouseSpeeder {
  29.     oldX := 0
  30.     oldY := 0
  31.     newX := 0
  32.     newY := 0
  33.     multiplier := 1.25
  34.    
  35.     increaseMultiplier(){
  36.         this.multiplier := Round(this.multiplier + 0.010000, 2)
  37.     }
  38.    
  39.     decreaseMultiplier(){
  40.         if(this.multiplier > 1.01){
  41.             this.multiplier := Round(this.multiplier - 0.010000, 2)
  42.         }
  43.     }
  44.    
  45.     showUpdate(){
  46.         Tooltip Format("Speed: {1}", this.multiplier)
  47.         Sleep 200
  48.         Tooltip
  49.     }
  50.    
  51.     updateMouseSpeed(){
  52.         Loop {
  53.             if (A_Index = 1){
  54.                 this.oldX := 0
  55.                 this.oldY := 0
  56.             }
  57.             Sleep 1
  58.             MouseGetPos &x, &y
  59.             this.newX := x
  60.             this.newY := y
  61.            
  62.             CoordMode "Mouse", "Screen"
  63.             diffX := this.newX-this.oldX
  64.             diffY := this.newY-this.oldY
  65.             MouseMove this.newX+(diffX*this.multiplier), this.newY+(diffY*this.multiplier)
  66.            
  67.             MouseGetPos &x, &y
  68.             this.oldX := x
  69.             this.oldY := y
  70.            
  71.             ;Tooltip Format("oldX: {1}, oldY: {2}`nnewX: {3}, newY: {4}", this.oldx, this.oldy, this.newX, this.newY)
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement