Hi,
    I am currently trying to use freeglut to collect key board information for a subwindow. But somehow keyboard information is only collected by main window.
The code works well for glut , but not for freeglut. Anyone can give me some idea what I should do. I am using visual studio 2008 on windows xp with freeglut 2.8.0 version.  Thanks in advance. part of the code is given below:

void SubWindowRoutine(int main_w,CameraSetupConfig *_cfg)
{
    static CameraSetupConfig cfg;
    cfg = *_cfg;
    if (calWindow == -1)
    {
        mainWindow = main_w;
        calWindow = glutCreateSubWindow(main_w, 0, 0, cfg.width, cfg.height);
        glutSetWindow(calWindow);
        glutDisplayFunc(perform_calibration_graphics);
        glutKeyboardFunc(cal_keyboard);                   
        glutSpecialFunc(cal_special_keys);
        glutSetCursor(GLUT_CURSOR_NONE);
        glutIdleFunc(subwindow_idle);

        glClearColor(cfg.background[0], cfg.background[1], cfg.background[2], cfg.background[3]);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);    // Clear Screen And Depth Buffer
        glColor3f(1.0,1.0,1.0);

        glDisable(GL_BLEND);

        // reset view matrices
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
    }


  glutSetWindow(calWindow);
  glutSwapBuffers( );
  _beginthread(Proc,0,&cfg);                          //here another thread starts
  while(!ts) Sleep(1000); // wait till the calibration starts

  glutPostWindowRedisplay(calWindow);
}

void cal_keyboard(unsigned char key, int x, int y)
{
      printf("Cal key is collected\n");      // never get this printout????
   //glutSetWindow(calWindow);
   if(ts)
   {
       addKey(key);
     
   }
   glutPostRedisplay ();
}


main func:
{
glutInit            ( &argc, argv ); // Erm Just Write It =)
  glutInitDisplayMode ( GLUT_RGBA | GLUT_DOUBLE ); // Display Mode
  glutInitWindowSize  ( 1024, 768 ); // If glutFullScreen wasn't called this is the window size
  mainWindow = glutCreateWindow    ( "NeHe's OpenGL Framework" ); // Window Title (argv[0] for current directory as title)
 // glutFullScreen      ( );          // Put Into Full Screen
  InitGL ();
  glutDisplayFunc     ( display );  // Matching Earlier Functions To Their Counterparts
  glutReshapeFunc     ( reshape );
  glutKeyboardFunc    ( keyboard );
  glutSpecialFunc     ( arrow_keys );
  glutIdleFunc          ( display );
  glutMainLoop        ( );          // Initialize The Main Loop

}