
Windows 10(그리고 아마도 다른 모든 Windows 버전도 마찬가지)에서 핸들 위나 아래의 스크롤 막대를 클릭하면 한 페이지씩 위나 아래로 스크롤됩니다. 하지만 대신 클릭한 위치로 이동하고 싶습니다.이미 해당 기능이 있습니다.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#Symbols
답변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+클릭이 삽입될 때마다 도움이 된다는 것을 알았습니다 .