octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kbhit/pause on Windows?


From: Nicholas Jankowski
Subject: Re: kbhit/pause on Windows?
Date: Wed, 2 Dec 2015 15:03:09 -0500

On Wed, Dec 2, 2015 at 2:36 PM, Rik <address@hidden> wrote:
12/2/15

Does kbhit() work correctly for any Windows users?  At least in my Windows
XP virtual machine the following code is broken.

x = kbhit

Instead of waiting for a single keypress and returning it, the terminal
seems to be line oriented.  You can type as many characters as you want,
but the last one has to be a <Return> in order for the function to
complete.  This also affects pause() since the two functions rely
internally on octave_kbhit() in sysdeps.cc.

I have a patch that works for me after cross-building with MXE, but I want
to confirm that others are having this problem.

--Rik


it's better than that.  issue the x = kbhit command multiple times after entering a bunch of characters before hitting enter the first time...

on mine, successive calls don't wait for a keypress. it immediately assigns the next character that had been entered before pressing <Return>. I guess it's storing them in some buffer somewhere.

>> x = kbhit
eoaeuoaeuoauoauou,.rckbe
x = e
>> x = kbhit
x = o
>> x = kbhit
x = a
>> x = kbhit
x = e
>> x = kbhit
x = u
>> x = kbhit
x = o
>>

Nick J.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]