Focus Follows Mouse on OSX: A Weird Quirk

April 6th, 2011
focus, mouse, osx, tech
When I first started using a mac, the lack of focus-follows-mouse [1] really bugged me. I looked into changing it, saw that steve yegge had determined it was pretty much impossible to change, figured out how to turn it on for terminal and x11, and stopped there. People suggested that if it bugged me this much I should just spend all my time in x11, but I wasn't unhappy enough to switch.

Recently, though, I noticed something strange: focus will follow the mouse into terminal almost all the time. Supposedly, the way focus follows mouse works for terminal (and x11) is that within one application you can do whatever you want with your keystrokes and the multiple windows of terminal or x11 are all running as one application. So if I have terminal up I can type into any terminal windows just by moving the mouse. I shouldn't be able to go from typing an email to typing in terminal; that's supposed to be impossible.

What I see instead is that whatever program I have focused, if I move the mouse into terminal then type, that typing shows up. This includes proper handling of the shift and control keys, but command is a little weird (command-N opens a new window correctly, command-T opens a new window instead of a new tab, command-V does nothing). This appears to work all the time except when the previously focused window is on a different physical screen than the terminal.

This indicates that there's something terminal is doing that's different than what steve yegge tried, because he found:

I start my little app (which has no UI), move the mouse into a window from a non-foreground application, and I can type into it!

Except I can only type unmodified keys. It's completely ignoring my keyboard event posts for Shift, Control, Alt and Command. That's the lie part. They said they'd generate flags changed events. They lied.

So maybe there's still hope for focus follows mouse on mac osx? How does terminal do it?

[1] This is where you choose which window your typing goes into by putting the mouse over that window. To switch from typing in firefox to typing in my email client, I'd just need to slide the mouse over. Both windows and mac by default make you click to choose the window, which is usually called click-to-focus.

Comment via: facebook

Recent posts on blogs I like:

Fraudsters: Turn Yourself In

Rip off the Band-Aid

via Thing of Things December 27, 2024

Developing the middle ground on polarized topics

Avoiding false dichotomies The post Developing the middle ground on polarized topics appeared first on Otherwise.

via Otherwise November 25, 2024

How to eat vegan on Icon of the Seas

Royal Caribbean has a new giant cruise ship, Icon of the Seas, which has a large selection of food options.

via Home November 21, 2024

more     (via openring)