key numbers
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)
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement