unbuffered stdout
Hi everyone,
Normally, >cat > temp a b c d ctrl-d the file is wrote after ctrl-d. Is there any way to perform a write with a CR? |
Quote:
Code:
buf= |
Hi Catkin,
I tried to unbuffer the xev. so that I can grep every event with CR. I hope there is some setting to made the stdout unbuffer. Thanks any way. |
Ah! This is a continuation of your Slow reponse >xev | grep keyPress thread. A good try but I don't think it will work because I theorise xev itself is doing the buffering; it probably checks where its stdout is going then, if it is a terminal, does not buffer it (or line buffers it) or, if it is to pipe or file, buffers it. If my theory is correct there are two options; modifying xev source (possible and an interesting exercise) or run xev with output to terminal and intercept the data. The bootlogd executable does something along those lines.
|
Hi catkin,
I do not agree with you. xev alone will give you the problem the moment the result is is pass to stdout if you case is true. But it did not happened, the problem is the stdout | waiting for the EOL like a file that cause the delay. In order to solve this, we can either make the stdout to accept CR or make the buffer size = 1 or smaller than the keypress event record size, which will help the response of the solution. I hope some guru may highlight me how to achieve this. I had tried to write my own application to capture all the keypress but facing problem on ctrl, shift and alt key(windows also). I had tried to set the parameter of termio. No luck. I had tried to search online and read some reference book in library hope to discover some thing for this little problem. Still Trying !!!! Let hope something will happened next few day. Thanks anyway. |
All times are GMT -5. The time now is 09:45 PM. |