[Dev-C++] pthreads, cin.get & key codes
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Tony B. <tbo...@ly...> - 2004-07-20 08:23:16
|
Hi there, I am programming a simple win32 console app which I would like to keep portable to other platforms. What is a good way to fetch interactive keyboard input? I mean input without having to press ENTER each time? I was thinking about doing this with threads, e.g. a KeypressEventDispatcher thread and a KeyPressEventHandler thread using the pthreads lib. Do you think this is a good idea? How are those threads layered with respect to the native Windows OS threads? Suppose my KeyboardEventDispatcher thread listens for keyboard input with cin.get(my_char) and the console app window loses focus, will this thread keep on running in the background? Will it keep on catching keypress events? And a last question: is there a header file with symbolic expressions for key codes? in windows there's "virtual key codes" (i think it was in windows.h), is there some standard equivalent for that? (I mean for non-ASCII characters) Thanks! -- _______________________________________________ Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 |