| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | waiting for keyboard input |
MB> I'm tryin to write a multi-threaded program, and
MB> one of the threads is to wait for keyboard input, and
MB> notify the main thread that there input coming in.
MB> Unforetunately, I have no idea how to get the thread to
MB> wait until there is keyboard input, when I attempt to
MB> use _getch(), it gives me gives me an exception.
MB> Anyways, seeing as this is extrodinarily basic, I
MB> figured I'd be able to get an answer quickly. (BTW,
MB> this is a text-mode app, not PM)
#define INCL_KBD
#include
void GetKeys(void* pv)
{
KBDKEYINFO CharData;
APIRET16 rc;
pv = pv; /* we don't use this, stop complaining. */
for(;;)
{
rc = KbdCharIn(&CharData, -1, 0);
/* character is in CharData.chChar, scan code in CharData.chScan, etc. */
}
}
If you don't have PRCP.INF, let me know - I can send it to you. (I won't
be here again until Saturday, so you may look around - FREQ PRCP.* from
1:342/3 - he may have it online, as may Bob Juge (ftp.juge.com), or it may
even be on Hobbes.) PRCP.INF has all this information and more on the
16-bit API, which is what you require.
--- Maximus/2 3.01
* Origin: Tanktalus' Tower BBS (PVT) (1:342/708)SEEN-BY: 270/101 711/401 409 410 413 430 808 809 934 955 712/407 515 624 628 SEEN-BY: 713/317 @PATH: 342/5015 61 3615/50 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.