CoordMode confusion... Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

CoordMode confusion...

Post by kunkel321 » 20 May 2024, 14:43

This code

Code: Select all

#SingleInstance
#Requires AutoHotkey v2+


CoordMode 'CaretGetPos', 'Screen'

!^q::
{
   If CaretGetPos(&mbx, &mby)
      msgbox 'caret Pos ' mbx 'x, ' mby 'y'
   else
      MsgBox 'no caret 4 U'
}
Yields this error:
Error: Parameter #1 of CoordMode is invalid.

Specifically: CaretGetPos

004: CoordMode('ToolTip', 'Screen')
▶ 005: CoordMode('CaretGetPos', 'Screen')
008: {
009: If CaretGetPos(&mbx, &mby)
CaretGetPos does appear to be listed in the docs here though.... Do I have a typo in there??
ste(phen|ve) kunkel
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: CoordMode confusion...  Topic is solved

Post by mikeyww » 20 May 2024, 14:58

Yes. The page that you cited notes the following possible target types: ToolTip, Pixel, Mouse, Caret, and Menu. Take your pick.
User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

Re: CoordMode confusion...

Post by kunkel321 » 20 May 2024, 15:16

Yes, of course. It's Caret not CaretGetPos. :facepalm:
ste(phen|ve) kunkel
Post Reply

Return to “Ask for Help (v2)”