if the windows differ, then start a timer (hs.timer.doAfter) for however long you want to hover.use eventtap to track mouse movement, checking the window under the mouse pointer against the frontmost window.then check out the docs for hs.eventtap in hammerspoon.įor Auto-Raise, I think you'd need to do something like: However, if you really want to try something more applicable across all applications, I would read the above link well, especially the section where he talks about event-taps. I can't use Cmd-V to paste things, but I can live with that. now I can hover over a terminal window and type into it. luckily this supports accepting text input without being focused by typing defaults write FocusFollowsMouse -bool YES into a terminal window and restarting the Terminal application. well, only one window in a given application can be key, and only the key window can receive text, and Hammerspoon can't change the key window of an application without raising it.įor me, the only application I really cared about being able to manipulate without having to bring it forward was the Apple Terminal application. And if the other window is in the same application (think multiple terminal windows). The Mac doesn't do well with this because only the front-most application (active application) has an active menubar which means only it can receive command keys (shortcuts), etc. The other flavor leaves the windows where they are, but switches keyboard focus to the application under the mouse pointer. This is usually not what people mean/want, especially if they're coming from Linux backgrounds, because it can have the effect of things popping forward and backwards, or introducing a noticeable delay that takes just as long as a mouse click would. in this type, you move your mouse over a window, it hovers for a time, and if it hovers long enough, then the other application is brought to the front and made the Active application. For some it really should be called "Auto-Raise". If you want to go forward, I strongly suggest reading it, but I'll summarize a bit here.įirst, Focus-Follow-Mouse means different things to different people. There is a (long), but informative write up on this at. Apple doesn't really support FFM, so even with the notes that follow, expect it to be buggy and for some applications to simply not work no matter what you try. to my knowledge, no one has done this yet with Hammerspoon, though I think you might be able to get to something close. it depends on what you really mean, which applications you want, and how much effort you're willing to put into it. Local watchKeyDown = hs.eventtap.Long answer. If event:getFlags() and event:getCharacters() = "z" then Also, it does not work at all for moving full-screened apps around in macOS.Īny input appreciated! function clickdown(event) When I use it to click and drag windows around (my main use case) it does not show the window moving with the mouse, only jumping to the mouse location when buttons are released. The code below is as close as I've gotten, but it's not perfect. I'm looking for a way to map a key combo (something like fn+z) to a left mouse click that is maintained for as long as the key press is maintained.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |