N++ x,y pixel locations for cursor!
tooltipsy last edited by
I use N++ in conjunction with AHK - rather like ma & pa, so to speak. In fact, there are some things in N++ that I’d like to use AHK to automate, on behalf of faster AHK code production… sort of bootstrappy that way. But, recently I’ve run acropper with what might be a definition issue. An attempt to use AHK to simplify file save functions… i.e. bind the function to a single hotkey, say F10, isn’t successful because I’m unable to programatically ‘know’ the x,y pixel location of the cursor in circumstances where it would be a REALLY good thing to know! Inet research on this points out many ideas or procedures for “locating” the N++ cursor… but each time I dig into one of them it turns out to not be that, and instead is discovered to be ‘locate the insertion point…’ I guess my issue is this: The location of the cursor in N++ can be the same as the location of next character insertion, but frequently it is not such. If I use HOME, to force the “cursor” to BoL (Beginning of Line), what, in fact, has happened is that the next character to be inserted (point) is now located at BoL, whilst the cursor, bless its heart, remains off in the distance, never having moved at all. So here’s my question for N++ gurus - is there a way in N++ to force the --> cursor <-- to a known x-y pixel location on the N++ window? (Of interest here is the term “relative.” Such a location would always be relative since the N++ edit window is inclined to move, shrink, disappear, and so on. A relative position could be, or probably would be, defined as x and y pixels of the resident machine’s video structure from, say, the upper left corner of this particular session’s window presentation.) Sorry if this gets messy, but it really is intriguing, especially with 4 monitors of differing sizes… the AHK stuff I use gets into that, er, a lot. Thanks for any ideas here - and Merry Christmas!
PeterJones last edited by
There is the mouse cursor (often the arrow symbol) and there is the editor’s caret (the vertical bar or similar where you are typing).
The mouse cursor is controlled by the OS, and is independent of the editor’s caret.
The only time they interact is when you click and Windows OS sends a message to Notepad++ and tells it where and what was clicked. Other than those messages, Notepad++ has no information on the mouse cursor’s xy position.
Alan Kilborn last edited by
I don’t know much about AHK, but there’s some info that might interest you HERE.