Beispiel #1
0
void specialPressed(int key, int x, int y)
{   switch (key)
    {   /** Calibration movements **/
    case GLUT_KEY_PAGE_DOWN:
    {   screen.translate(0,0,-0.5);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;
    case GLUT_KEY_PAGE_UP:
    {   screen.translate(0,0,0.5);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;
    /** Helper Informations **/
    case GLUT_KEY_F1:
    {   calibratorHelper.switchCalibration();
    }
    break;
    case GLUT_KEY_F2:
    {   calibratorHelper.switchInstructions();
    }
    break;
    case GLUT_KEY_F3:
    {   calibratorHelper.switchFPS();
    }
    break;
    case GLUT_KEY_F4:
    {   calibratorHelper.switchHeadCalibration();
    }
    break;
    }
}
Beispiel #2
0
void handleKeypress(unsigned char key, int x, int y)
{   switch (key)
    {   //Quit program
    case 'q':
    case 27:
    {   cleanup();
        exit(0);
    }
    break;
    case 'p':
    {
        // Print the current trial
        for (map<string,double>::iterator iter = factors.begin(); iter!=factors.end(); ++iter)
        {
            cerr << iter->first << " " << iter->second << " ";
        }
        cerr << endl;
    }
    break;
    case '2':
    {   screen.translate(0,-0.5,0);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;
    case '8':
    {   screen.translate(0,0.5,0);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;
    case '4':
    {   screen.translate(-0.5,0,0);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;
    case '6':
    {   screen.translate(0.5,0,0);
        cam.updateMonitorPoint(screen);
        calibratorHelper.setScreen(screen);
    }
    break;

    case 'g':
        calibratorHelper.switchGrid();
        break;
    case 'b':
        calibratorHelper.switchBoxes();
        break;
    case 'f':
        glutFullScreen();
        break;
    }
}