Hi Dee,

    Thanks a lot for your reply. Yes, this code is the one I downloaded from the post you updated to the support website of SR research. I really appreciate your update. But the code I downloaded there does not seem work well on my computer. As I mentioned there is no key responses when I try to do calibration. I will try the demo code from freeglut and let you know. By the way, do you mind sending me a copy of your code again. Thanks a lot.

Best,
LJ

> Date: Fri, 29 Jun 2012 23:14:31 +0800
> From: dcnieho@gmail.com
> To: freeglut-developer@lists.sourceforge.net
> Subject: Re: [Freeglut-developer] Help: subwindow, no key responses
>
> Hi L J,
>
> This looks suprisingly much like sample code for (Free)GLUT
> calibration routine for the EyeLink. I am using that too for my work,
> and it works fine with FreeGLUT 2.8.
>
> Could you try the subwindow demo that comes with 2.8? Keep your
> (mouse) cursor either over the white area (main window) or over one of
> the grey areas (subwindows) while typing letters on the keyboard. Does
> that work?
>
> Also, search on the SR research forum for freeglut. I made some
> changes to the GLUT example (can't remember what). Its been a while,
> but i might have been having similar issues. I fixed them at some
> point nd uploaded it to the forum. Make sure you browse to the last
> post in the thread to get the attachment there.
>
> Hope this helps, feel free to contact me further offlist.
>
> Best,
> Dee
>
> On Fri, Jun 29, 2012 at 9:33 PM, L J <doutmost@hotmail.com> wrote:
> > 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
> >
> > }
> >
> >
> >
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Freeglut-developer mailing list
> > Freeglut-developer@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/freeglut-developer
> >
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Freeglut-developer mailing list
> Freeglut-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freeglut-developer