(我不想听别人说我有多疯狂想要那个!:)
焦点跟随鼠标也被称为点对焦点、指针焦点和(在某些实现中)草率焦点。[添加其他术语,使搜索更容易!]]鼠标光标
(我不想听别人说我有多疯狂想要那个!:)
焦点跟随鼠标也被称为点对焦点、指针焦点和(在某些实现中)草率焦点。[添加其他术语,使搜索更容易!]]鼠标光标
当前回答
So I decided to improve again on the work I did on the MouseFocus.app which still had some flaws. Those are fixed now. I renamed the whole thing to "AutoRaise" to better reflect what this tool does: When you hover a window it will be raised to the front (with a delay of your choosing) and gets the focus. The tool can be downloaded here. To use it, copy it to your /Applications/ folder making sure it is executable (chmod 700 AutoRaise). Then double click it from within Finder. To quickly toggle it on/off you can use the applescript below and paste it into an automator service workflow. Then bind the created service to a keyboard shortcut via System Preferences|Keyboard|Shortcuts.
更新(29-03-2017):AutoRaise二进制文件已经更新。如果命令行上没有指定delay,它现在也会在同一个主文件夹中查找autorrise .delay文件。这在使用下面的applescript时特别有用,因为“启动应用程序”不支持命令行参数。延迟应该以50ms 20ms为单位指定。例如,在一个终端上执行'echo 1 > ~/AutoRaise.delay'命令,指定延时为20ms。
on run {input, parameters}
tell application "Finder"
if exists of application process "AutoRaise" then
quit application "/Applications/AutoRaise"
display notification "AutoRaise Stopped"
else
launch application "/Applications/AutoRaise"
display notification "AutoRaise Started"
end if
end tell
return input
end run
更新(18-04-2019):来源https://github.com/sbmpost/AutoRaise
更新(05-06-2020):默认延迟时间被设置为2,轮询时间被缩短。这些设置可以防止快速移动鼠标(例如到达顶部菜单)时意外地弹出窗口。同时一个扭曲鼠标功能已经添加和内存泄漏已被修复。欲了解更多细节,请参阅README
其他回答
Codetek有一款产品可以做到这一点,但他们从未为Leopard或更高版本发布过版本。
MondoMouse可以做焦点跟踪鼠标,但不能自动提升。 即使是焦点跟随鼠标也坏了。 例如,它不能很好地使用命令-标签(如果你命令-标签到一个新应用程序,并且不碰鼠标,那么它不应该将焦点切换回鼠标指针所处的位置——我非常确定我所见过的Linux中的每个实现都能做到这一点,但MondoMouse没有)。
你可以只在终端窗口中启用焦点跟随鼠标(没有自动升起)(只需在终端中执行以下命令):
defaults write com.apple.Terminal FocusFollowsMouse -string YES
同样,对于X11窗口:
defaults write org.x.X11 wm_ffm -bool true
(对于10.5.5之前的mac版本,这是:
defaults write com.apple.x11 wm_ffm true
)
我不知道还有其他应用程序支持它。
So I decided to improve again on the work I did on the MouseFocus.app which still had some flaws. Those are fixed now. I renamed the whole thing to "AutoRaise" to better reflect what this tool does: When you hover a window it will be raised to the front (with a delay of your choosing) and gets the focus. The tool can be downloaded here. To use it, copy it to your /Applications/ folder making sure it is executable (chmod 700 AutoRaise). Then double click it from within Finder. To quickly toggle it on/off you can use the applescript below and paste it into an automator service workflow. Then bind the created service to a keyboard shortcut via System Preferences|Keyboard|Shortcuts.
更新(29-03-2017):AutoRaise二进制文件已经更新。如果命令行上没有指定delay,它现在也会在同一个主文件夹中查找autorrise .delay文件。这在使用下面的applescript时特别有用,因为“启动应用程序”不支持命令行参数。延迟应该以50ms 20ms为单位指定。例如,在一个终端上执行'echo 1 > ~/AutoRaise.delay'命令,指定延时为20ms。
on run {input, parameters}
tell application "Finder"
if exists of application process "AutoRaise" then
quit application "/Applications/AutoRaise"
display notification "AutoRaise Stopped"
else
launch application "/Applications/AutoRaise"
display notification "AutoRaise Started"
end if
end tell
return input
end run
更新(18-04-2019):来源https://github.com/sbmpost/AutoRaise
更新(05-06-2020):默认延迟时间被设置为2,轮询时间被缩短。这些设置可以防止快速移动鼠标(例如到达顶部菜单)时意外地弹出窗口。同时一个扭曲鼠标功能已经添加和内存泄漏已被修复。欲了解更多细节,请参阅README
虽然这还远远不是一个完整的解决方案,但OSX(10.11)中内置了两个方便的操作:
⌃-click (control-option-click)—切换焦点而不抬高窗口
⌘-click (command-click) -在窗口中单击而不切换焦点
不确定这些快捷方式是什么时候引入的,因为我在任何地方都找不到关于它们的文章。
一些潜在有用的建议,部分“焦点悬停”与双屏幕。它不能修复一些问题,比如当另一个屏幕已经有输入框焦点时,在输入框中输入。但它可能会帮助那些来这里“专注于悬停”的人。
没有这个修复,我总是不得不“焦点点击”在监视器之前,我可以上下文点击任何东西。
你可以通过这个获得“focus on hover”的一些方面:
进入“系统首选项” 选择“任务控制”选项 在那里你应该看到“显示有单独的空间”,去掉它
然后至少选择了Monitor1,现在你可以立即点击Monitor2中的某些内容,比如电子邮件或Tab,而不需要第一次“焦点点击”。
通常情况下,这可能并不适用于每个人,这取决于操作系统版本和其他事情。
鼠标聚焦现在可以在macOS中实现,在我的Mojave中,使用chunkwm。 请参阅此堆栈溢出响应以获得“无自动触发”解决方案。自动驾驶是通过离开激活的
chunkc set ffm_disable_autoraise 0
在~ / .chunkwmrc。
编辑2019-09-12:
Chunkwm已经被yabai取代。如何安装:
brew tap koekeishiya/formulae
brew install yabai
mkdir -p ~/.config/yabai/
printf 'yabai -m config focus_follows_mouse autoraise' >> ~/.config/yabai/yabairc
brew services start yabai