我的這款滑鼠側面有額外的前進和後退按鈕,這是我使用的 AHK 腳本,它的主要用途是:
- 如果在按住 XButton2(前進按鈕)和右鍵(右鍵)的同時向上捲動滑鼠中鍵,則會傳送Alt+ 6。
- 如果在按住滑鼠 XButton2 的同時向上捲動滑鼠中鍵,系統音量會增加 2%
問題是它還會同時觸發滑鼠 XButton2(前進)的預設操作,因此我想在按住上述按鍵時阻止它發送「前進」。
~XButton2 & WheelUp::
GetKeyState, RButtonState, RButton, ;Gets the mouses Rbutton state
If RButtonState = D ;Checks if Rbutton is pressed down
if (x_1 > 1919) ;if mouse cursor's X(Horizontal) position is greater than 1919px then:
Send !6 ;Sends ALT+6
else Send !4 ;Sends ALT+4
SetNumlockState, On
If RButtonState = U ;Checks if Rbutton is NOT pressed down
SoundSet, + 2 ;if Rbutton is not pressed down scrolling up while holding XButton2 increases volume
return