Capturing key stokes

Hi, is it possible to capture a key combination such as alt and f or alt and e. I've tried capturing the ascii values, but only the single characters are captured and not the combination. It's basically for a menu system that i'm trying to develope, for a windows console.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

What return value is the if statement testing? Cos, the if the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. Therefore, shouldn’t the if condition be testing for the most significant bit using "=="?

To be more proper & by 0x8000 because the windows sparse documentation only specifies that it's 0 if another process or window as keyboard focus. I suppose the bit pattern
being 0x0110 when the key is up. I've never heard of anyone having a problem doing it the way mentioned with VK_MENU.

for a menu system that i'm trying to develope, for a windows console

Exactly this should be on the window's board. You could do
this with poking at memory like in dos and have it not compile.
My bet is that you could also do this with getch but it wouldn't handle as good.

Would someone just be able to tell me what condition the if statement is testing?

if (GetAsyncKeyState(VK_MENU))

An if statement can only be evaluated and executed if the condition is true. The GetAsyncKeyState() function returns a short int, so how can that return be either true or false for the if statement to work.

Return Values
If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. The return value is zero if a window in another thread or process currently has the keyboard focus.

Windows 95: Windows 95 does not support the left- and right-distinguishing constants. If you call GetAsyncKeyState with these constants, the return value is zero.