(我不想听别人说我有多疯狂想要那个!:)
焦点跟随鼠标也被称为点对焦点、指针焦点和(在某些实现中)草率焦点。[添加其他术语,使搜索更容易!]]鼠标光标
(我不想听别人说我有多疯狂想要那个!:)
焦点跟随鼠标也被称为点对焦点、指针焦点和(在某些实现中)草率焦点。[添加其他术语,使搜索更容易!]]鼠标光标
当前回答
大约10年来,我一直在周期性地回到这个问题上,最后我找到了一个简单的解决方案:AutoRaise https://github.com/sbmpost/AutoRaise
默认情况下,它启用焦点跟随鼠标和自动升起。您可以使用配置选项来延迟自动触发。
它也有所谓的“扭曲”功能,当你Command-Tab到窗口时,将鼠标指针居中。在我尝试之前,我从来不知道我需要它,但一旦我尝试了,我就不能没有它!
其他回答
尝试了这些选项后,我的Command-Tab开始表现得很奇怪。以下是它如何再次关注应用程序的解决方案:
之前的一个特性,即终端的窗口焦点随着鼠标移动而改变的能力,在10.6中被打破,导致Command-Tab不能正确地转移窗口焦点。要解决这个问题,只需在终端中粘贴以下命令:
默认写com.apple.Terminal FocusFollowsMouse -string否
然后重新启动终端。
如果有人感兴趣的话,这里有一个多监视器自动对焦的玩具级实现:https://bitbucket.org/sivann/mac-screenfocus/src/master/
它大部分工作,但不能处理同一应用程序在不同显示器的多个窗口。如果你将鼠标移到另一个显示器上,会将焦点移到上一个应用程序上。
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
鼠标聚焦现在可以在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
大约10年来,我一直在周期性地回到这个问题上,最后我找到了一个简单的解决方案:AutoRaise https://github.com/sbmpost/AutoRaise
默认情况下,它启用焦点跟随鼠标和自动升起。您可以使用配置选项来延迟自动触发。
它也有所谓的“扭曲”功能,当你Command-Tab到窗口时,将鼠标指针居中。在我尝试之前,我从来不知道我需要它,但一旦我尝试了,我就不能没有它!