We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6284581 commit 7ab345eCopy full SHA for 7ab345e
src/compat/gui.jl
@@ -168,14 +168,20 @@ end
168
169
function _python_input_hook()
170
try
171
- while true
172
- yield()
173
- @static if Sys.iswindows()
+ @static if Sys.iswindows()
+ # on windows, we can call yield in a loop because _kbhit() lets us know
+ # when to stop
174
+ while true
175
+ yield()
176
if ccall(:_kbhit, Cint, ()) != 0
177
break
178
end
179
+ sleep(0.01)
180
- sleep(0.001)
181
+ else
182
+ # on other platforms, if readline is enabled, the input hook is called
183
+ # repeatedly so the loop is not required
184
185
186
catch
187
return Cint(1)
0 commit comments