Detect if cursor is in an input field?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MarkPhil
Posts: 5
Joined: 18 Apr 2017, 20:03

Detect if cursor is in an input field?

17 Nov 2017, 04:22

I spend a lot of time reading PDFs and I've tried implementing Vim-style keybindings for scrolling, etc. while in my PDF reader. The problem is that when I go to type in a comment or search box, I need to remember to suspend my script. Is there a way AHK can detect whether the cursor is in a text input field or not, so that I can tell AHK not to apply the new keybindings when I'm entering text? I looked around in the forums and the documentation but didn't see anything like this.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Detect if cursor is in an input field?

17 Nov 2017, 04:49

You/the script has to be able to detect the control that is currently active in real-time (SetTimer) to decide if to toggle your keybindings.
Use AHK's winSpy (or whatever equivalent to identify those controls IDs). Good luck :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Black_dog, Google [Bot] and 121 guests