nmd*_*_07 7 browser firefox google-chrome scrolling
我通常在屏幕上并排运行两个 Web 浏览器实例。当我阅读外语新闻或文章时,我在一个浏览器中翻译了它,覆盖了一半的屏幕,而在另一个窗口中运行的原始文章则覆盖了另一半屏幕。
现在,我希望能够同时向下滚动在同一浏览器的两个不同实例上运行的两个页面,以便我可以比较翻译文本和原始文本。我要么使用 Firefox,要么使用 Chrome。有没有办法让它工作同时向下滚动功能?
这可以通过使用以下脚本通过AutoHotkey magic完成,该脚本应存储在.ahk文件中以供执行。双击该文件以启动脚本,通过在托盘栏中的绿色“H”图标上单击鼠标右键并选择退出来停止它。
该脚本是为协调滚动两个窗口而编写的。您必须首先选择要滚动的窗口,逐个包含它们。该脚本复制了以下用于协调滚动的键:Wheel Up、Wheel Down、Page Up、Page Down。
该脚本使用一些热键进行初始化。您可以编辑它以使用其他一些热键或删除不需要的热键。我选择的那些描述如下。
F1 : Starts a new group of windows
F2 : Includes the currently active window in the group
F3 : Shows the windows in the group even if minimized
F4 : Closes all windows in the group
Run Code Online (Sandbox Code Playgroud)
这是脚本。它在我的测试中起作用。
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Process, Priority, , High
SetWinDelay 0
g = 1 ; Used to generate unique group names
; Reload script to reinitialize all variables, since there is no delete group
f1::
Reload
return
; Add currently active window to the group
f2::
WinGet, active_id, ID, A
GroupAdd, grpname, ahk_id %active_id%
return
; Restore all windows in the group to be visible
f3::WinRestore, ahk_group grpname
return
; Close all windows in the group
f4::GroupClose, grpname , A
Reload
return
; This intercepts scroll keys on the active window and duplicates them on the other window
#IfWinActive ahk_group grpname
WheelUp::
WheelDown::
PgUp::
PgDn::
MouseGetPos, mX, mY ; remember mouse position in current window
Send {%A_ThisHotKey%}
GroupActivate grpname ; activate the next window of this group
If (A_ThisHotKey = "WheelUp" || A_ThisHotKey = "WheelDown")
MouseMove, 200, 200, 0 ; move the mouse over the currently active window
Send {%A_ThisHotKey%}
GroupActivate grpname ; Activate previous window
MouseMove, mX, mY, 0 ; Restore its mouse position
return
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5928 次 |
| 最近记录: |