
Windows 10 (およびおそらく他のすべての Windows バージョン) では、ハンドルの上または下のスクロールバーをクリックすると、1 ページ上または下にスクロールします。 しかし、代わりに、クリックした場所にジャンプしたいと思います。そのための機能がすでにあるこれは、Shift+を使用するClickか、(一部のアプリケーションでは) 右クリックしてコンテキスト メニューから [ここをスクロール] を選択するとトリガーされます。ただし、この機能をデフォルトの動作にしたいと考えています。
スクロールバーの左クリックのデフォルトのアクションを「ここにスクロール」にするにはどうすればいいですか?
理想的には、レジストリ設定か何かがあるはずです。しかし、スクロールバーの左クリックを検出し、Shiftこれらのクリックに対してを挿入する AutoHotKey スクリプトのようなハックも検討します。
答え1
この AutoHotkey スクリプトを試してください:
~LButton Up::
; Get the current position of the mouse cursor:
MouseGetPos, MouseX, MouseY, A ; A means the active window
; Get the position and size of the active window:
WinGetPos, WinX, WinY, WinWidth, WinHeight, A
If (MouseX > (WinWidth - 20) and MouseX < WinWidth and MouseY > 200) ; right edge
SendInput, +{Click} ; + is the symbol for Shift
return
https://www.autohotkey.com/docs/commands/MouseGetPos.htm https://www.autohotkey.com/docs/commands/WinGetPos.htm https://www.autohotkey.com/docs/Hotkeys.htm#シンボル
答え2
これはこの答えいくつかのバグ修正と、スクリプトが事前定義されたアプリケーションでのみアクティブになるようにフィルターが追加されました。
まだ改善の余地があります。たとえば、スクロール ハンドルをドラッグできなくなりました。
オートホットキースクリプト
#NoEnv
#Warn All
#If MouseIsOverScrollbar("firefox|chrome|notepad|hh")
LButton::
; "+" is the modifier for shift
SendInput, +{Click}
return
#If
MouseIsOverScrollbar(Exe_Regex) {
if (A_Cursor != "Arrow")
return False
MouseGetPos, _X, _Y, WindowUnderMouse
WinGet, Exe, ProcessName, ahk_id %WindowUnderMouse%
if (not Exe ~= "^(" . Exe_Regex . ")\.exe")
return False
WinActivate, ahk_id %WindowUnderMouse%
MouseGetPos, MouseX, MouseY
WinGetPos, _X, _Y, WinWidth, _H, ahk_id %WindowUnderMouse%
ScrollbarWidth = 25
HeaderWidth = 40
return MouseX > WinWidth - ScrollbarWidth
and MouseY > HeaderWidth
}
CoordMode, Mouse, Client
AutoHotKey 2 の場合は、およびに切り替えることをお勧めしますWinGetClientPos
。
デバッグのSoundPlay *-1
場合、Shift キーを押しながらクリックすると便利だとわかりました。