Mouse Cursor's X and Y from Map Grid Mouse Position?

Hi there!

I need help in figuring out one thing connected to MV and mouse cursor system. I have tried to make that 2 game variables try get Mouse Cursor X and Y connected to Map Grid constantly (with a parallel trigger) , but I have been unsuccessful. What sort of Script Command I should use to get a specific Map X and Y coordinate where player's mouse is?

Thank you for your help if you know the solution 😉
This would help development of an unique system I am working on.
I think these are the lines of code you're seeking~
Code:
$gameMap.canvasToMapX(TouchInput.x);
$gameMap.canvasToMapY(TouchInput.y);
Yes! This is what I was looking for! Thank you caethyril!
Great! I assume it worked for the OP as well, so...

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

For future reference (no worries, you're not in trouble):

@CaptainGameMaker, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

👋

Original thread: https://forums.rpgmakerweb.com/threads/mouse-cursors-x-and-y-from-map-grid-mouse-position.109334/