0

I have a teacher that gave me the project idea of connecting 2 screens (seperate computers) together much like what a dual monitor setup works. The idea is to send the cursor position over to another computer (that would be the reciever) and when the sender computer's cursor hits the edge of the screen, it would move the other computer's cursor to the start of the screen (again, to mimic a dual monitor setup).

I've asked around and got some recomendations to calculate the velocity of my cursor and when it hits the edge send the expected output to the other computer but that wouldn't work when my cursor is at the edge, it has no velocity (to the direction of the edge)

as I said in the beggining, the results I want are simply for my program to be able to detect if my mouse is going (for example) right when I'm at the right edge of my screen ; anyone knows how to do this?

ArchyInUse
  • 159
  • 10
  • Hello... Ideally you need to make an attempt first. Have a go.. show some code and then I'm sure someone will assist. If you make no attempt at all.. then you may get down voted. Cheers – Wheels73 Jan 02 '19 at 12:43
  • Well that's my problem, my server side works but I have no idea how to detect the mouse movements if it's at the edge and that's the whole point. No idea how to go about this :/ – ArchyInUse Jan 02 '19 at 12:49
  • What app is it. Winforms? Web app? – Wheels73 Jan 02 '19 at 12:51
  • console app, running a socket via a server that I created – ArchyInUse Jan 02 '19 at 12:55
  • Have you seen this [related post](https://stackoverflow.com/questions/1316681/getting-mouse-position-in-c-sharp)? – Axel Kemper Jan 02 '19 at 13:04
  • Yes, I have. Again, I have a problem with using those because when I'm at the edge of the screen, my mouse cursor doesn't change it's X/Y values (relative to the edge, for example if I'm at the right edge of my screen, my x axis will just max out and won't move) when it's at the edge and thus I won't know how to detect the mouse movement to send to the other screen. – ArchyInUse Jan 02 '19 at 13:10
  • If you are moving the cursor beyond the screen, you could use extrapolation to estimate the position from the last known position. This is done by car navigation systems when the car is entering a tunnel. The car position gets updated even after the GPS signal is inerrupted. Add a multiple of the last velocity vector to the last location. Use the elapsed time as factor. – Axel Kemper Jan 02 '19 at 23:18

0 Answers0