change the way to read char to non-blocking, usually much better for video game