快速交換滑鼠慣用手(Autoit) (AUTOIT)

快速交換滑鼠慣用手(Autoit) (AUTOIT)

因為自己左右手都能操控滑鼠,但每次都要去控制台 設定

慣用手左手 或右手,所以用auoit寫個快速 交換左右手的程式

按F8是慣用右手,F9是慣用左手,ESC關閉程式
HotKeySet("{ESC}", "_exit")
HotKeySet("{F8}", "_switch1");右鍵
HotKeySet("{F7}", "_switch2");左鍵
#NoTrayIcon
$On = False
 


While 1
    Sleep(100)
Wend

Func _exit()
    Exit 0
EndFunc

Func _switch1()
    $On = False
    If $On = False Then
        DllCall("user32.dll", "int", "SwapMouseButton", "int", 0)
 
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons", "REG_SZ", "0")

    EndIf
EndFunc

Func _switch2()
    $On = True
    If $On = True Then
        DllCall("user32.dll", "int", "SwapMouseButton", "int", 1)
  
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons", "REG_SZ", "1")
    EndIf
 
EndFunc


如有錯誤 歡迎指正