Mac OS X에서 초점 추적 마우스 (및 자동 올리기)
(나는 내가 얼마나 미친 지에 대해 듣고 싶지 않다! :)
Focus-follows-mouse는 point-to-focus, 포인터 초점 및 (일부 구현에서는) 느슨한 초점으로도 알려져 있습니다. [더 많이 검색 할 수있는 다른 용어를 추가하십시오!] X-mouse
명령 행에서 다음 명령을 실행하여 Terminal.app에 대해이를 수행 할 수 있습니다.
defaults write com.apple.Terminal FocusFollowsMouse -bool true
X11 앱의 경우 다음을 수행 할 수 있습니다.
defaults write com.apple.x11 wm_ffm -bool true
Snow Leopard에서는 다음을 대신 사용하십시오.
defaults write org.x.X11 wm_ffm -bool true
시스템 전체를 에뮬레이트하는 CodeTek Virtual Desktop이라는 프로그램이 있지만 비용은 $$입니다 (OSX Leopard 용 버전은 제공되지 않음).
Steve Yegge 는 이것에 대한 에세이를 작성했는데, 그는 적절한 확장을 작성하려고 시도하지 못했습니다. 그 후 OS X 용 포커스 후속 마우스 응용 프로그램을 찾으려고했지만 실패했습니다.
Focus-follows-mouse는 메뉴 막대가 화면 상단에 있도록 설계 되었기 때문에 OS X에 특히 적합한 입력 방법이 아닙니다. 마우스를 응용 프로그램 창 밖으로 이동하여 메뉴로 이동하면 도중에 다른 응용 프로그램의 창과 교차하면 메뉴가 변경됩니다.
예, dreeves 의견에 대한 답변으로 터미널 (또는 데스크탑의 다른 단일 응용 프로그램)에서는 완벽하게 작동합니다. 단지 영향을 줄 다른 창은 터미널 창이므로 창을 전환해도 메뉴가 변경되지 않습니다. X11 앱에는 일반적으로 메뉴 막대가 창에 내장되어 있기 때문에 X11에서 잘 작동하므로 액세스하기 위해 창을 떠날 필요가 없습니다.
물론 포커스가 변경되거나 메뉴가 전환되기 전에 인위적인 지연을 도입하여 메뉴 변경 문제를 해결할 수는 있지만 다른 데스크탑 에서처럼 작동하지는 않습니다.
이것은 완전한 솔루션과는 거리가 멀지 만 OSX (10.11)에 내장 된 두 가지 편리한 동작은 다음과 같습니다.
⌃⌥- 클릭 (control-option-click)-창을 올리지 않고 초점을 전환
⌘- 클릭 (명령-클릭)-포커스를 전환하지 않고 창에서 클릭
이 단축키가 언제 도입되었는지 확실하지 않습니다. 어디에서나 작성된 단축키를 찾을 수 없었습니다.
자수정 은이 기능을 지원합니다. 로 쉽게 설치할 수 있습니다 brew cask install amethyst
.
여기 내가 사용하는 구성 파일이 있습니다. 초점 추적 마우스 외에 모든 기능을 끕니다. 에 저장하십시오 ~/.amethyst
.
{
"LAYOUTS": "----------------------",
"layouts": [
],
"MODIFIERS": "----------------------",
"Valid modifiers are": [
"option",
"shift",
"control",
"command"
],
"mod1": [
],
"mod2": [
],
"COMMANDS": "----------------------",
"Commands are": {
"cycle-layout": "Cycle layout to the next layout",
"cycle-layout-backward": "Cycle layout to the previous layout",
"focus-screen-1": "Focus the main window on the first screen",
"focus-screen-2": "Focus the main window on the second screen",
"focus-screen-3": "Focus the main window on the third screen",
"focus-screen-2": "Focus the main window on the second screen",
"focus-screen-3": "Focus the main window on the third screen",
"focus-screen-4": "Focus the main window on the fourth screen",
"throw-screen-1": "Throw the focused window to the first screen",
"throw-screen-2": "Throw the focused window to the second screen",
"throw-screen-3": "Throw the focused window to the third screen",
"throw-screen-4": "Throw the focused window to the fourth screen",
"shrink-main": "Shrink the main pane of the current layout",
"expand-main": "Expand the main pane of the current layout",
"increase-main": "Increase the number of windows in the main pane",
"decrease-main": "Decrease the number of windows in the main pane",
"focus-ccw": "Move window focus counter-clockwise on the current screen",
"focus-cw": "Move window focus clockwise on the current screen",
"swap-ccw": "Swap focused window with the next window going counter-clockwi$
"swap-cw": "Swap focused window with the next window going clockwise",
"swap-main": "Swap focused window with the main window of its screen",
"throw-space-1": "Throw the focused window to the first space",
"throw-space-2": "Throw the focused window to the second space",
"throw-space-3": "Throw the focused window to the third space",
"throw-space-4": "Throw the focused window to the fourth space",
"throw-space-5": "Throw the focused window to the fifth space",
"throw-space-6": "Throw the focused window to the sixth space",
"throw-space-7": "Throw the focused window to the seventh space",
"throw-space-8": "Throw the focused window to the eighth space",
"throw-space-9": "Throw the focused window to the ninth space",
"throw-space-8": "Throw the focused window to the eighth space",
"throw-space-9": "Throw the focused window to the ninth space",
"toggle-float": "Toggle the focused window between being floating and tiled"
},
"screens": "3",
"cycle-layout": {
"mod": "mod1",
},
"cycle-layout-backward": {
"mod": "mod2",
},
"select-tall-layout": {
"mod": "mod1"
},
"select-wide-layout": {
"mod": "mod1"
},
"select-fullscreen-layout": {
"mod": "mod1"
},
"select-column-layout": {
"mod": "mod1"
},
"mod": "mod1"
},
"focus-screen-1": {
"mod": "mod1"
},
"focus-screen-2": {
"mod": "mod1"
},
"focus-screen-3": {
"mod": "mod1"
},
"focus-screen-4": {
"mod": "mod1"
},
"throw-screen-1": {
"mod": "mod2"
},
"throw-screen-2": {
"mod": "mod2"
},
"throw-screen-3": {
"mod": "mod2"
},
"throw-screen-4": {
"mod": "mod2"
"throw-screen-4": {
"mod": "mod2"
},
"shrink-main": {
"mod": "mod1"
},
"expand-main": {
"mod": "mod1"
},
"increase-main": {
"mod": "mod1"
},
"decrease-main": {
"mod": "mod1"
},
"focus-ccw": {
"mod": "mod1"
},
"focus-cw": {
"mod": "mod1"
},
"swap-screen-ccw": {
"mod": "mod2"
},
"swap-screen-cw": {
},
"swap-screen-cw": {
"mod": "mod2"
},
"swap-ccw": {
"mod": "mod2"
},
"swap-cw": {
"mod": "mod2"
},
"swap-main": {
"mod": "mod1"
},
"throw-space-1": {
"mod": "mod2"
},
"throw-space-2": {
"mod": "mod2"
},
"throw-space-3": {
"mod": "mod2"
},
"throw-space-4": {
"mod": "mod2"
},
"mod": "mod2"
},
"throw-space-5": {
"mod": "mod2"
},
"throw-space-6": {
"mod": "mod2"
},
"throw-space-7": {
"mod": "mod2"
},
"throw-space-8": {
"mod": "mod2"
},
"throw-space-9": {
"mod": "mod2"
},
"toggle-float": {
"mod": "mod1"
},
"toggle-tiling": {
"mod": "mod2"
},
"display-current-layout": {
"mod": "mod1"
"display-current-layout": {
"mod": "mod1"
},
"MISC": "----------------------",
"floating": [],
"float-small-windows": false,
"mouse-follows-focus": false,
"focus-follows-mouse": true,
"enables-layout-hud": false,
"enables-layout-hud-on-space-change": false
}
The menu issue is the only reason traditional focus-follows-mouse wouldn't work.
Here's an alternative: don't change focus until a key is pressed on the keyboard. This would cover 95% of use cases for focus-follows-mouse, and would make this old curmudgeonly X user really happy. I don't know how many times I'll be scrolling through a web page in Chrome, and hit Command-T to open a new tab, and find the tab opening in the Terminal instead. If my brain hasn't picked up on this in 8 months of using a Mac, it never will.
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.
Update (29-03-2017): The AutoRaise binary has been updated. If no delay has been specified on the command line, it will now also look for an AutoRaise.delay file in the same folder. This is particularly useful when using the applescript below because 'launch application' does not support command line arguments. The delay should be specified in units of 50ms. For example to specify a delay of 150ms run this command once in a terminal: 'echo 3 > AutoRaise.delay'
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
Update (18-04-2019): The source https://github.com/sbmpost/AutoRaise
I currently use MondoMouse and even with its quirks I couldn't use my mac without it. They have a free trial and I would recommend it to everyone.
Codetek had a product that did this but they never released a version for Leopard or later.
MondoMouse can sort of do focus-follows-mouse, but not auto-raise. Even the focus-follows-mouse is broken though. For example, it doesn't play well with command-tab (if you command-tab to a new application and don't touch the mouse then it should not switch focus back to wherever the mouse pointer happens to be -- I'm pretty sure every implementation in Linux I've seen gets this right but MondoMouse doesn't).
You can enable focus-follows-mouse (no autoraise) for just Terminal windows (just execute the following in a terminal):
defaults write com.apple.Terminal FocusFollowsMouse -string YES
And similarly for X11 windows:
defaults write org.x.X11 wm_ffm -bool true
(For mac versions previous to 10.5.5 this was:
defaults write com.apple.x11 wm_ffm true
)
I don't know of any other applications that support it.
chunkwm supports this too (by default I believe): chunkwm
Interesting that Leopard has one flavor of focus-follows-mouse (sans autoraise) enabled by default. The scroll wheel works in unfocused windows.
Unfortunately CodeTek Virtual Desktop Pro is no longer developed, and the company seems to have gone out of business a few years back..
Historic reference: http://www.codetek.com/ctvd/ (does not work on new OS X versions!)
Historic review: http://www.osnews.com/story/6144
Using CodeTek Virtual Desktop Pro you were able to get Focus-Follow-Mouse and disable Auto-Raise, and it also had a Pager for the virtual desktops -- similar to how Fvwm works on Linux. It really worked perfectly -- the best piece of software that I've ever bought. It worked consistently with all apps, and switching apps, moving windows to different workspaces, and navigating workspaces worked much easier than how it is implemented in the latest OS X versions [10.6, 10.7, 10.8]
Unfortunately with Mac OS X 10.5 VirtualDesktop Pro stopped working, and it looks like Apple actively made sure that CodeTek will not continue to work on it.
It is sad that Apple crushed CodeTek and it's product - Virtual Desktop Pro was really superior to how OS X workspaces are currently implemented. It worked basically like Fvwm on LINUX - super fast navigation -- without unnecessary clicks or mouse gestures...
It saddens me to see that Apple dictates window manager (Finder) behavior and does not seem to allow third-party replacements for the Finder anymore.
There is also the related issue of raise-on-click. Under OSX each time a window is clicked, it is also raised, thus potentially hiding other windows. This is problematic when working with copy/paste from two windows where one of them covers most of the screen. I like to keep a global (active in all workspaces) notepad from which I copy/paste stuff (could be anything from commands, text, todo items etc). This is challenging under OSX. It would be nice to have an option to disable raise-on-click.
Give DwellClick a try. Although, it's not for its intended purpose, the auto-click behavior has a side effect similar to auto-raise or focus-follows-mouse.
Personally, I only use the feature of left clicking after my cursor movement comes to rest, but there's also clicking with modifiers and a window dragging assist that's quite handy.
It's also a little frustrating while web browsing since you'll either want to disable the app or be more conscious of where the cursor rests (e.g. not on any links or buttons you don't intend to activate).
Focus follows mouse is now possible in macOS, Mojave in my case, using chunkwm. See this Stack Overflow response for a "no autoraise" solution. Autoraise is activated by leaving
chunkc set ffm_disable_autoraise 0
in ~/.chunkwmrc
.
Edit 2019-09-12:
chunkwm has been superseded by yabai. To install:
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
Experimenting with those options, my Command-Tab started to behave oddly. Here is the solution of how it gives focus to apps again:
It appears that a previous feature, namely the ability for Terminal's window focus to change with mouse movement, is broken in 10.6 and causes Command-Tab to not transfer window focus correctly. To fix the problem, just paste the following command in a Terminal:
defaults write com.apple.Terminal FocusFollowsMouse -string NO
Then restart Terminal.
Solution: Because I was so used to autoraise in Windows I badly missed it on the Mac. The solution I found for the Mac is Zooom (yes, three o's). It has an autoraise function. You can even set milliseconds to wait before autoraise. Can't live without it. Autoraise is an option in prefs as you can see in the screenshot https://www.macupdate.com/app/mac/23203/zooom http://coderage-software.com/zooom/index.html
Tested MondoMouse (https://www.atomicbird.com/about/mac-apps) on MacOS Mojave. Seems to work fine for me!
To install the prefpane, there will be a notice "enable access for assistive devices" that does not reside in the System Preferences > Accessibility anymore. You'll have to set it in Security & Privacy > Accessibility > Privacy
There will be several warnings about allowing MondoMouse in each app you have open, but once set it works fine! What a relief :)
You can't really do it well, because the Mac interface simply isn't designed with focus-follows-mouse (with or without auto-raise) in mind. I doubt that's going to change any time soon, and unless it does, everybody who tries to implement focus-follows-mouse will run into the same hurdles and wind up with an unsatisfactory result (to those who want such a thing).
So, yes, you are crazy for wanting this — but for technical reasons. Get used to using the Mac on its own terms and I'm sure your desire to force it to behave just like whatever X11 stuff you used to use will subside in a bit as you find new efficient ways of working.
참고URL : https://stackoverflow.com/questions/98310/focus-follows-mouse-plus-auto-raise-on-mac-os-x
'Programing' 카테고리의 다른 글
다른 JSP 파일 포함 (0) | 2020.06.08 |
---|---|
Android Studio에서“URI가 등록되지 않았다”고보고하는 이유는 무엇입니까? (0) | 2020.06.08 |
SVN : 개정을 위해 커밋 된 파일 목록 (0) | 2020.06.08 |
Crontab-디렉토리에서 실행 (0) | 2020.06.08 |
grep에서 반환되는 결과 수를 어떻게 제한합니까? (0) | 2020.06.08 |