Read a password: on mobile! Thanks to MD XF's recent challenge, we can now read passwords in many different languages! The problem is, now we need to port our applications to mobile devices, and they do password entry a little differently.

Challenge


Read a string from the keyboard.
Each time a characterk is entered, display it for a short time interval.
After the time interval has passed OR the user has entered another character, replace k with some character c.


Rules


c must be constant; it must be the same character.
c can be any visible character (i.e. it cannot be a newline, space, tab, or unprintable).
c can't be based on any inputted k; c must be defined/constant
before the first k is read.
c must be the same every time the program is run.
c can be one of the values given as k if by accident, as long as all other rules are followed.

You must print k in realtime. As soon as the user enters a new k, you must display it immediately.
k should be visible to the end user before being changed to c; the time interval shall not be less than 0.5 seconds.
k should be replaced by c within a reasonable time; the time interval shall not exceed 5 seconds.
As soon as a new character is entered, whether or not the time interval has expired, you should replace k with c and use the entered key as the new k immediately.

It is acceptable to clear and redraw the screen each time you need to change a character.
You may use any reasonable methods of input and output as long as all other rules are followed.
You may assume that the number of characters inputted is never longer than the terminal/graphical window width.
If using a terminal, your program should terminate after a newline is entered or EOF is reached.
Your program should function as outlined here on both mobile and other environments.

Your program may assume that the input will only contain printable characters (letters, numbers, symbols) and possibly a terminating newline (no backspace, arrow keys, delete, etc).
Your program may terminate when Ctrl+C is pressed.
You may terminate your program by closing a window, if your program launches one.


Scoring

This is code-golf, so the shortest answer in each language wins!

Example

Here is an example of what it should look like. Note this is recorded on a mobile platform, but should also work on a desktop platform.
HTML + JavaScript, 20+105 = 125 bytes

&lt;input id=I oninput=v=I.value;s='*'.repeat(l=v.length-1);I.value=s+v[l];clearTimeout(I.t);I.t=setTimeout(`I.value=s+'*'`,1e3)


The delay between the entry of k and the letter becoming * is one second.

JavaScript oninput, Formatted

v=I.value;
s='*'.repeat(l=v.length-1);
I.value=s+v[l];
clearTimeout(I.t);
I.t=setTimeout(`I.value=s+'*'`,1e3)


Test Snippet

Added the ending bracket (&gt;) for better compatibility.



&lt;input id=I oninput=v=I.value;s='*'.repeat(l=v.length-1);I.value=s+v[l];clearTimeout(I.t);I.t=setTimeout(`I.value=s+'*'`,1e3)&gt;