• Advertisement

Archived

This topic is now archived and is closed to further replies.

key numbers

This topic is 5896 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

can someone please tell me the numbers for the keys or tell me where i can find them. also when i press alt my programme crashes anyone know why? (i can''t get my collision detection working i know it''s easy but it want work it''s making me go mad)

Share this post


Link to post
Share on other sites
Advertisement
I am assuming you mean the keys in Win32. All of the Virtual Keys (things like, alt, F1, tab, Shift, Escape) are defined in WinUser.h which is included in windows.h. To detected if a key is pressed, in your WindowProcedure do something like this:

case WM_KEYDOWN:
switch( LOWORD(wparam) ) {
case VK_ESCAPE: // Escape was pressed
// Do something
return 0;

case ''A'': // A Was pressed
// do something
return 0;

default: // A key we don''t care about was pressed
break;
}

Hope this helps

Share this post


Link to post
Share on other sites

  • Advertisement