void MyWindow::keyboard(MyWindow::KeyCode key, ButtonAction action, int mods, int x, int y) { #ifdef USEANTTWEAKBAR // to fix some mapping issues with special keys // TODO: find the real Fix... if(action == MyWindow::BUTTON_PRESS) { switch(key) { case NVPWindow::KEY_HOME: if(TwEventSpecialGLUT(106/*GLUT_KEY_HOME*/, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_END: if(TwEventSpecialGLUT(107/*GLUT_KEY_END*/, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_LEFT: if(TwEventSpecialGLUT(100/*GLUT_KEY_LEFT*/, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_RIGHT: if(TwEventSpecialGLUT(102/*GLUT_KEY_RIGHT*/, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_BACKSPACE: if(TwEventKeyboardGLUT(TW_KEY_BACKSPACE, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_DELETE: if(TwEventKeyboardGLUT(TW_KEY_DELETE, x,y) ) { postRedisplay(); return; } break; case NVPWindow::KEY_ENTER: case NVPWindow::KEY_KP_ENTER: if(TwEventKeyboardGLUT(TW_KEY_RETURN, x,y)) { postRedisplay(); return; } break; case NVPWindow::KEY_ESCAPE: //postQuit(); break; } } TwEventMousePosGLFW(x,y); if(TwEventKeyGLFW(key, action) ) { //if(TwEventSpecialGLUT(key, x,y) ) { postRedisplay(); return; } #endif WindowInertiaCamera::keyboard(key, action, mods, x, y); }
void Special(int key, int x, int y) { TwEventSpecialGLUT(key, x, y); switch (key) { case GLUT_KEY_UP: _camera->move(-10.0f); break; case GLUT_KEY_LEFT: break; case GLUT_KEY_RIGHT: break; case GLUT_KEY_DOWN: _camera->move(10.0f); break; } }
void Special(int k, int x, int y) { TwEventSpecialGLUT(k, x, y); glutPostRedisplay(); }
void RotationsViewer::onKeyboardSpecial(int key, int x, int y) { TwEventSpecialGLUT(key, x, y); }
void OnSpecial(int glutKey, int mouseX, int mouseY) { // send event to AntTweakBar if (TwEventSpecialGLUT(glutKey, mouseX, mouseY)) glutPostRedisplay(); // request redraw if event has been handled }
// Special key event callbacks int SpecialKeyCB(int glutKey, int mouseX, int mouseY) { TwSetCurrentWindow(glutGetWindow()); return TwEventSpecialGLUT(glutKey,mouseX,mouseY); }
static void ArrowKeyCallback(int key, int x, int y) { KeyboardCallback(key, x, y); TwEventSpecialGLUT(key, x, y); }