If you want to test several individual keys, GetAsyncKeyState()you can use to poll for status. Otherwise, you must implement the message loop and process the messages WM_CHARin your application.
You can access the original win32 functions with a library similar to the following if your environment does not yet support the win32 functions that you need.
RAA - win32-api @ raa.ruby-lang.org
Here are the links for GetAsyncKeyState().
GetAsyncKeyState () @MSDN
Virtual Key Codes @MSDN (used as values for GetAsyncKeyState and other functions)
If you decide to go with the message outline, you will need to implement it in the same stream as the window for your application. A brief description is available here:
Message Loop on Microsoft Windows @Wikipedia
, . , , , . , ; Windows .
, wikipedia. DispatchMessage Windows . Windows WM_CHAR .
DispatchMessage @MSDN
WM_CHAR @MSDN
, /, WM_KEYUP WM_KEYDOWN.
WM_KEYUP @MSDN
WM_KEYDOWN @MSDN
, GetAsyncKeyState() , . WM_ACTIVATE WM_SETFOCUS/WM_KILLFOCUS, , , , .
WM_ACTIVATE @MSDN
WM_SETFOCUS @MSDN
WM_KILLFOCUS @MSDN