Reputation: 21098
I have the problem, that my console application wait at random points, until i press the left mouse button. The application is written in C#. I don't use ReadKey
or something else in my application (Which even should wait for a key pressed not the mouse).
Does anyone had similar problems?
Thank you!
Upvotes: 1
Views: 446
Reputation: 111870
Perhaps you have the Quick Edit mode enabled in your app (Properties->Options->Edit Options). Then if you click the cursor enters in selection mode and the app seems to stop until you click again.
I've made some checks... It seems that if you enter in Quick Edit mode (and you don't exit it), the next time the program will do a Console.Write
or similar the program will be "suspended". Clearly programs that don't write anything to output are immune to this problem.
So:
for (int i = 0; ; i++) { }
Immune to Quick Edit.
while
for (int i = 0; ; i++) { Console.Write(i); }
Not immune :-)
Upvotes: 3