   Keyboard Input using win32 and C++
  Hey guys, I'm making a snake using c++ and the win32 API. I'm still conceptualizing and I'm wondering how does it identify keyboard input.Here is the code I used before using C and ncurses:/******Movement using the Arrow Keys*********/bool isValidMove(int direction) {switch (direction) {case WM_KEYLEFT:if ( mv == KEY_UP || mv == KEY_DOWN ) return true;else return false;break;case KEY_RIGHT:if ( mv == KEY_UP || mv == KEY_DOWN ) return true;else return false;break;case KEY_UP:if ( mv == KEY_RIGHT || mv == KEY_LEFT ) return true;else return false;break;case KEY_DOWN:if ( mv == KEY_RIGHT || mv == KEY_LEFT ) return true;else return false;break;default:return false;break;}I don't know how to convert this to C++ or something that would help identify them. :( Hope you guys help.[Edited by - nightbox69 on April 10, 2010 4:44:38 AM]