void KinectEcard::keyDown( KeyEvent event ) { if( event.getChar() == 'f' ) setFullScreen( ! isFullScreen() ); else if ( event.getChar() == KeyEvent::KEY_SPACE ){ snapshot(); } else if( event.getChar() == KeyEvent::KEY_p ) { if( mParams.isVisible() ) mParams.hide(); else mParams.show(); }else if( event.getChar() == KeyEvent::KEY_SPACE ){ snapshot(); }else if( event.getChar() == KeyEvent::KEY_ESCAPE ){ shutdown(); }else if( event.getChar() == KeyEvent::KEY_c ){ clear(); } }
void keyDown(KeyEvent event) { if (mEditMode == EditMode_RECORD) return; if (event.getCode() == KeyEvent::KEY_ESCAPE) { delete [] mCtrlPoints; exit(1); } if (event.getChar() == 'p') { if (mParams.isVisible()) { mParams.hide(); } else { mParams.show(); } } if (event.getCode() == KeyEvent::KEY_F1) { mScale = 0.5; } if (event.getCode() == KeyEvent::KEY_F2) { mMeshMode = (!mMeshMode); } if (event.getCode() == KeyEvent::KEY_F12) { resetMesh(); } if (event.getCode() == KeyEvent::KEY_F5) { if (mHasMovie) mMovie.stop(); mDispMode = DispMode_GUIDE; } if (event.getCode() == KeyEvent::KEY_F6) { if (mHasMovie) mMovie.stop(); mDispMode = DispMode_GUIDE1; } if (event.getCode() == KeyEvent::KEY_F7) { if (mHasMovie) mMovie.stop(); mDispMode = DispMode_GUIDE2; } if (event.getCode() == KeyEvent::KEY_F8) { if (mHasMovie) mMovie.stop(); mDispMode = DispMode_GUIDE3; } if (event.getCode() == KeyEvent::KEY_F9) { if (mHasMovie) mMovie.stop(); mDispMode = DispMode_GUIDE4; } if (event.getCode() == KeyEvent::KEY_F10) { if (mHasMovie) { mMovie.play(); mDispMode = DispMode_MOVIE; } } /* if (event.getCode() == KeyEvent::KEY_SPACE) { if (mDispMode == DispMode_GUIDE) { mDispMode = DispMode_MOVIE; } else if (mDispMode == DispMode_MOVIE) { mDispMode = DispMode_GUIDE; } } */ Vec2f move = Vec2f::zero(); if (event.getCode() == KeyEvent::KEY_UP) { move = Vec2f( 0, -1); } if (event.getCode() == KeyEvent::KEY_DOWN) { move = Vec2f( 0, 1); } if (event.getCode() == KeyEvent::KEY_LEFT) { move = Vec2f(-1, 0); } if (event.getCode() == KeyEvent::KEY_RIGHT) { move = Vec2f( 1, 0); } for (int k = 0; k < mCtrlPointsNum; ++k) { if (mCtrlPoints[k].isSelected) { mCtrlPoints[k].mag += move; } } }