![]() |
| | #1 |
| Registered User Join Date: Nov 2001
Posts: 9
| |
| Malikive is offline |
| | #2 |
| Linguistic Engineer... Join Date: Aug 2001 Location: CA
Posts: 2,420
| use kbhit ()... kbhit () checks the keyboard buffer if there's an available keystroke and getch () returns it... if no keystrokes exist, getch () waits until you press something into the keyboard buffer and retrieves it... so, check if a keystroke exists and return it with getch (), if it is not available, don't return getch () and return zero [or some other flag value]... any ?uestions? -hth
__________________ hasafraggin shizigishin oppashigger... |
| doubleanti is offline |
| | #3 |
| Registered User Join Date: Nov 2001
Posts: 9
| Hey man, thanks for that advice, it worked! I'm not a very good programmer yet but that command will come in handy =). Thanks again! |
| Malikive is offline |
| | #4 |
| Skunkmeister Join Date: Aug 2001
Posts: 2,572
| only problem with kbhit() is that it is not part of either the c or c++ standards therefore not all compilers have this facility.
__________________ Free the weed!! Class B to class C is not good enough!! And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi |
| Stoned_Coder is offline |
| | #5 |
| Linguistic Engineer... Join Date: Aug 2001 Location: CA
Posts: 2,420
| oh... well good anyway... coindentally i use the interrupt so i can get the ASCII and scan codes both... but what is the standardized alternative then SC? thank you!
__________________ hasafraggin shizigishin oppashigger... |
| doubleanti is offline |
| | #6 |
| Skunkmeister Join Date: Aug 2001
Posts: 2,572
| Unfortuneately there isn't one DA. This is because it is highly operating system specific. In dos as you know you use interrupts.In windows you use GetAsyncKeyState().In linux/unix you use ____________ (salem please fill in the blank!) .Sorry I'm a windows guy!
__________________ Free the weed!! Class B to class C is not good enough!! And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi |
| Stoned_Coder is offline |
| | #7 |
| Linguistic Engineer... Join Date: Aug 2001 Location: CA
Posts: 2,420
| i would have thought the protocols for such a thing were more closely tied to the hw... speaking of which, all software does use hw interrupts? right? i'm pretty sure... else what links the hw to the sw? hmmm.
__________________ hasafraggin shizigishin oppashigger... |
| doubleanti is offline |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with keyboard input | fighter92 | Game Programming | 6 | 03-20-2009 09:41 AM |
| faq: cached input with mygetch() | ichijoji | Linux Programming | 4 | 06-18-2008 11:36 PM |
| Using low-level keyboard for input | hdragon | C++ Programming | 25 | 12-24-2007 02:13 PM |
| Stealing Keyboard input | zort15 | C++ Programming | 2 | 04-16-2007 02:22 PM |
| Keyboard Input | Unregistered | C++ Programming | 5 | 07-29-2002 11:41 AM |