keypress icon indicating copy to clipboard operation
keypress copied to clipboard

Support block=FALSE on Windows

Open weshinsley opened this issue 4 years ago • 0 comments

Hi Gabor, Happy New Year to you,

I've made a small PR here - which implements the non-blocking behaviour on Windows. Previously, the block arg in keypress_read(int block) was ignored in keypress-win.c - so I've just made it exit returning code zero (KEYPRESS_CHAR) for now.

It seems to work (from a Windows Command prompt running Rterm) - my crude test is to call k<-keypress(block=FALSE) - which returns 0 quickly - and then repeat and hammer a key just after pushing enter, and you get that key returned instead. Not much of a test! But I think that might be enough to be able to code something fairly simple (and fun) around it.

I am not sure what the version number should be - the version on CRAN (1.2.0) seems a bit ahead of your repo. But anyway, I hope this is helpful - I am hoping to code something silly around it in the next few days, and will try and contribute more to this if you'd like it.

See PR #8

weshinsley avatar Dec 30 '20 12:12 weshinsley