Categories > Coding > C# >

Finding mouse coordinates in console

Posts: 0

Threads: 0

Joined: ?

Reputation:

Posted

After some searching, i couldn't find anything on how to do this. I need the mouse coordinates within the console app. Not just anywhere on the screen. I'm planning on making interactable buttons in a console application and my plan is to wait for a mouse click and if the current mouse position is in the button position, then do blahblahblah.

So back to the original question, does anyone know how to do this? (i am fully aware that there are console gui libraries but i can't understand it's confusing documentation)

  • 0

WhiteCat

Paradox#8032

Posts: 230

Threads: 18

Joined: Dec, 2020

Reputation: 1

Replied

If you mean this:

var relativePoint = this.PointToClient(Cursor.Position);
Source: https://stackoverflow.com/questions/19164933/cursor-position-relative-to-application
  • 0

C# and JavaScript | Learning C++

Join [Cyrup]

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

@WhiteCat Oh thanks i missed that cause my search terms were specified to console.

  • 0

WhiteCat

Paradox#8032

Posts: 230

Threads: 18

Joined: Dec, 2020

Reputation: 1

Replied

@63568 Your welcome, whats your discord?

  • 0

C# and JavaScript | Learning C++

Join [Cyrup]

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

@WhiteCat deaddlocust#1757

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )