Detect (from autohotkey) if a text input field is focused

0

I want to implement a series of hotkeys using Autohotkey (mostly to improve my effectiveness), but I want them to only be active when I'm typing text, and not when I'm navigating or playing. I know Autohotkey can set conditions based on which window is focused, and so I could set these hotkeys to only trigger inside notepad++, MSWord, etc.

The problem is that I would also like these hotkeys to work when I'm typing text in firefox (like this question right here). However, I can't just set them to always trigger inside firefox because I'm not always typing in it and so it would mess up other hotkeys associated to firefox. So, is there a way I can set these hotkeys to only be active when I'm inside a text input field? This way they wouldn't mess up with regular firefox hotkeys while I'm navigating, but would still be active when I'm typing.

Malabarba

Posted 2011-04-08T03:23:14.667

Reputation: 7 588

Answers

0

The only way I can think of doing this is possibly with a Greasemonkey script. (https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) You'll have to write an event listener in Javascript that binds a function to every single input field on a page. When the field is focused, the function triggers the desired hotkey / keycombination and at the same time lets you go on your merry way.

Not 100% sure but this might be a step in the right direction at least.

Joshua

Posted 2011-04-08T03:23:14.667

Reputation: 4 290

0

You should be able to have autohotkey use a condition based on a window class, use window spy to see what the window class of the text edit window is and activate on that rather than the application window.

WolfmanJM

Posted 2011-04-08T03:23:14.667

Reputation: 844