   Untitled
  Hii've got a question on using keyboardwhen i have my keyboard function this way it works fine when pressing q :void keyboard (unsigned char key, int x, int y){switch (key){case 27:// esc -> exitexit(0);case 'q':posx++;}}but when i add another case for w as i showed below, although w works well, but i see no change in posx when i press q.void keyboard (unsigned char key, int x, int y){switch (key){case 27:// esc -> exitexit(0);case 'q':posx++;case 'p':posx--;}}What's wrong here ?Thanks   
  You need a break in there:void keyboard (unsigned char key, int x, int y){   switch (key)   {   case 27: // esc -> exit exit(0); break;   case 'q': posx++; break;   case 'p': posx--; break;   }}Without that, it "falls through" to the next statement. I'd also recommend having a read of This article on using your debugger, since it'll help you track down these sort of bugs.   