Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

C# How did they create wait cursor?, In character subsystem

views
     
flashang
post Mar 17 2022, 08:32 AM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


When display such custom cursor,
you need to do a lot of extra things when you need readline from keyboard.

sad.gif


flashang
post Mar 17 2022, 07:53 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(FlierMate @ Mar 17 2022, 05:40 PM)
Yes, you've pinpointed the issue.

But it is quite easy, given this, in .NET:
CODE
while (true)
{
   if (Console.KeyAvailable)
       break;

   Console.Write('.');
}

...where it doesn't pause for keypress from user.  tongue.gif
*
Nope.
To handle "proper" readline, you need to check for backspace, insert / overwrite, arrow keys, some other keys such as ctrl / alt + keys...


flashang
post Mar 19 2022, 10:33 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(FlierMate @ Mar 19 2022, 05:26 PM)
But I wonder, why do we need to read keystroke when animating a wait cursor??
Interesting, looks like everyone was a DOS master.
*
After re-read the 1st post, realized this was talking about waiting cursor in console.
Not for 'waiting command cursor'

biggrin.gif



This post has been edited by flashang: Mar 19 2022, 10:43 PM
flashang
post Mar 19 2022, 10:41 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(silverhawk @ Mar 19 2022, 08:53 PM)
Like a normal progress bar you see on windows when you're transferring a file. Its quite common in command line scripts now.
*
If we look at recent common application, including web, desktop gui and console app,
The waiting cursor could be progress bar,
or some text info such as xx mb/sec, xx sec / min reminding, 1 of 999 steps / processes, ...

This may give user some info for them to decide if they are willing to wait until complete or terminate it.

Animation cursor may be is OK for short waiting, but not for long waiting time.

biggrin.gif



 

Change to:
| Lo-Fi Version
0.0214sec    0.61    6 queries    GZIP Disabled
Time is now: 19th December 2025 - 01:33 AM