View Single Post
Old 01-04-2011, 06:13 PM   #9
Kanalia
Newbie

 
Join Date: Mar 2011
Location: ,
Posts: 13
Default

Quote:
Originally Posted by The Fifth Horseman View Post
Thank you, that helped.
It seems I'm going to have to keep GetAsyncKeyState for one special case, namely the right ALT button. It returns the Left CTRL scancode when pressed, and I can only determine it's that button by checking GetAsyncKeyState.
You're welcome.

As to the "special case", you don't need to keep GetAsyncKeyState just for that. The left and right ALT keys have their own keycodes defined, known respectively as VK_LMENU and VK_RMENU. Have you tried those?

Also, IIRC, the RALT = LCTRL problem occurs usually when a non-US (or maybe non-English?) keyboard layout is set in the OS. Just for kicks, try out how your program works with US keyboard layout set (instead of Polish, which I presume is the case with you ).

Also, if the above doesn't work, using the same way you already listen for WM_KEYDOWN messages, you could just add the special case for the WM_SYSKEYUP message. Details are available here: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
It's easy to understand so I won't explain.

Japo:
Ah yes, it's not that easy. WinAPI is a pretty complicated API and there's usually more ways than one (or even two) to accomplish something, even if it seems to be something trivial

Quote:
Originally Posted by Japo
and both WinAPI functions decide not to tell some equivalent keys apart, otherwise they could do the job.)
Well if that were really the case then we wouldn't have any good solution, right?

Utilizing XNA for a purely desktop windowed app makes about the same sense as using SDL in this case.

Last edited by Kanalia; 01-04-2011 at 06:21 PM.
Kanalia is offline                         Send a private message to Kanalia
Reply With Quote