Skip to content
Snippets Groups Projects
Commit 26283b91 authored by deuce's avatar deuce
Browse files

The ansi_input API currently requires that ai.add be called every 100ms...

do so.

Also, for stdin, we can't select() for read since it's using the FILE* not
the file descriptor.
parent 3ab963ad
No related branches found
No related tags found
No related merge requests found
......@@ -7,15 +7,6 @@ var k;
while(!js.terminated) {
if (parent_queue.poll(0))
break;
// Can't select() files on Win32.
if(system.platform == 'Win32') {
k = read(1);
}
else {
k = undefined;
if (socket_select([0], 0.1).length == 1)
k = read(1);
}
if (k != undefined && k.length)
ai.add(k);
k = read(1);
ai.add(k);
}
......@@ -8,6 +8,5 @@ while(!js.terminated) {
if (parent_queue.poll(0))
break;
k = console.inkey(0, 100);
if (k.length)
ai.add(k);
ai.add(k);
}
......@@ -71,4 +71,6 @@ while(!js.terminated) {
for(i=0; i<k.length; i++)
ai.add(k.substr(i,1));
}
else
ai.add('');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment