MCPcopy Create free account
hub / github.com/covscript/covscript / kbhit

Function kbhit

sources/system/unix/common.cpp:148–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 }
147
148 int kbhit()
149 {
150 fd_set fds;
151 terminal_lnbuf(0);
152 terminal_echo(0);
153 struct timeval tv;
154 tv.tv_sec = 0;
155 tv.tv_usec = 0;
156 FD_ZERO(&fds);
157 FD_SET(0, &fds);
158 select(1, &fds, 0, 0, &tv);
159 int ret = FD_ISSET(0, &fds);
160 terminal_lnbuf(1);
161 terminal_echo(1);
162 return ret;
163 }
164 } // namespace conio
165
166 namespace file_system {

Callers

nothing calls this directly

Calls 2

terminal_lnbufFunction · 0.85
terminal_echoFunction · 0.85

Tested by

no test coverage detected