473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

C kbhit() help

109 100+
hey guys, i have a threaded program, i have loop that contunes until i get a kbhit()
then, i playback repetively untill i get another kbhit().

EDIT:
the first kbhit happens on a child thread of the second kbhit, the child thread comes before the loop starts

Problem:
the second kbhit() is always true, there for my

while(!kbhit())

is not working.

any ideas?
May 28 '08 #1
1 2432
when you are using nested kbhit(),
if you press any key then first loop is true after that if you press again second loop is true
Sep 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dbrown2 | last post by:
I'm having some trouble using kbhit inside the editor enviroments. I'm using win2000 with Python2.3 and win32all v157 versions. Any pointer on how this should be handled would be appreciated. Is...
1
by: Hans Georg Krauthaeuser | last post by:
Hey all, this is probably a FAQ, but I didn't found the answer... I use msvcrt.kbhit() to check for a user keyboard event on windows. But now, I would prefer to make the module independent...
7
by: DevarajA | last post by:
How can i know if there are characters in the standard input using only standard c++? I want to stop a loop when any key is pressed. -- Devaraja (Xdevaraja87^gmail^c0mX) Linux Registerd User...
17
by: hugo27 | last post by:
June 28, 2004 I'm interested in finding a way to test the keyboard buffer for MT/Not MT. Tried kbhit() in system.h but it didn't do what I thought it would from reading the literature. Samples:...
6
by: exquisitus | last post by:
Hi all, I'm porting a DOS application to run on Linux. I need to replace this function or use an equivalent. Anyone knows how or where I can get this function's equivalent (or maybe someones...
1
by: Lakshan | last post by:
Hi, How do you emulate a key board hit in C# without actually reading in the character. For instance I have the following code Console.WriteLine("Press a enter to exit"); Console.ReadLine();...
1
by: Carsten Orthbandt | last post by:
This code: ---snip--- #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #include <tchar.h> #include <conio.h> int _tmain(int argc, _TCHAR*...
45
by: simnav | last post by:
In the following code something strange happens ! If I keep pressed any of ALT+Arrow, keys, they are extracted two times from buffer then getch seems to stop; if I release and press again ALT+arrow...
2
by: sk1988jun | last post by:
can anyone please tell me equivalent function in matlab for kbhit() which is a c fuction
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.