void ForelleVisualAppApp::keyDown( KeyEvent event ) { if( event.isAccelDown() && event.getCode()== app::KeyEvent::KEY_n ) { if(menueBar.isVisible()) menueBar.show(false); else menueBar.show(true); } else if( event.getCode() == app::KeyEvent::KEY_UP && !clusters.empty() ) { (*selectedCluster)->moveUp(1); } else if( event.getCode() == app::KeyEvent::KEY_DOWN && !clusters.empty()) { (*selectedCluster)->moveDown(1); } else if( event.getCode() == app::KeyEvent::KEY_LEFT && !clusters.empty() ) { (*selectedCluster)->moveLeft(1); } else if( event.getCode() == app::KeyEvent::KEY_RIGHT && !clusters.empty()) { (*selectedCluster)->moveRight(1); } else if( event.getCode() == app::KeyEvent::KEY_TAB ) { controller.changeSelectedCluster(clusters, selectedCluster); } else if(event.getCode() == app::KeyEvent::KEY_ESCAPE) setFullScreen(false); if(event.getCode() == 'f') setFullScreen(true); if(event.getCode() == '8') pos.y -=10; if(event.getCode() == '5') pos.y +=10; if(event.getCode() == '4') pos.x -=10; if(event.getCode() == '6') pos.x +=10; if(event.getCode() == app::KeyEvent::KEY_p){ scale++; } if(event.getCode() == app::KeyEvent::KEY_m){ scale--; } }
void AnotherSandboxProjectApp::keyDown( KeyEvent event ) { switch (event.getCode()) { case KeyEvent::KEY_SPACE: _DSPController->pause(); break; case KeyEvent::KEY_c: _clearField(); break; case KeyEvent::KEY_r: _randomField(); break; case KeyEvent::KEY_q: _randomAll(); break; case KeyEvent::KEY_s: { _clearField(); ivec2 gridSize = _DSPController->getGridSize(); ivec2 center = gridSize / 2; int centerIndex = center.x * gridSize.y + center.y; _DSPController->DefferedUpdateGrid[centerIndex].s[0] = (DSPSampleType)1.0; _DSPController->DefferedUpdateGrid[centerIndex - 1].s[0] = (DSPSampleType)1.0; _DSPController->DefferedUpdateGrid[centerIndex - 1 * gridSize.y].s[0] = (DSPSampleType)1.0; _DSPController->DefferedUpdateGrid[centerIndex - 2 * gridSize.y].s[0] = (DSPSampleType)1.0; } break; case KeyEvent::KEY_l: break; case KeyEvent::KEY_b: if (_params.isVisible()) _params.hide(); else _params.show(); break; } }
void OpenALTest::keyDown( KeyEvent event ) { switch ( event.getCode() ) { case KeyEvent::KEY_f: if ( !isFullScreen() ) { setFullScreen( true ); if ( mParams.isVisible() ) showCursor(); else hideCursor(); } else { setFullScreen( false ); showCursor(); } break; case KeyEvent::KEY_s: mParams.show( !mParams.isVisible() ); if ( isFullScreen() ) { if ( mParams.isVisible() ) showCursor(); else hideCursor(); } break; case KeyEvent::KEY_SPACE: mAudio.play( mSampleId ); break; case KeyEvent::KEY_ESCAPE: quit(); break; default: break; } }
void KaleidoscopeApp::keyDown( KeyEvent event ) { switch ( event.getCode() ) { case KeyEvent::KEY_f: if ( !isFullScreen() ) { setFullScreen( true ); if ( mParams.isVisible() ) showCursor(); else hideCursor(); } else { setFullScreen( false ); showCursor(); } break; case KeyEvent::KEY_s: mParams.show( !mParams.isVisible() ); if ( isFullScreen() ) { if ( mParams.isVisible() ) showCursor(); else hideCursor(); } break; case KeyEvent::KEY_v: mVerticalSyncEnabled = !mVerticalSyncEnabled; break; case KeyEvent::KEY_ESCAPE: quit(); break; default: break; } }
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 TerrainApp::keyDown( KeyEvent event ) { switch ( event.getCode() ) { case KeyEvent::KEY_f: if ( !isFullScreen() ) { setFullScreen( true ); if ( mParams.isVisible() ) showCursor(); else hideCursor(); } else { setFullScreen( false ); showCursor(); } break; case KeyEvent::KEY_s: mParams.show( !mParams.isVisible() ); if ( isFullScreen() ) { if ( mParams.isVisible() ) showCursor(); else hideCursor(); } break; case KeyEvent::KEY_ESCAPE: quit(); break; default: break; } }
void ForelleVisualAppApp::setup() { loadSettings(); // Setup the parameters clusterBar = ClusterBar( "Cluster Window", Vec2i( 200, 400 ) ); //Setup menueBar menueBar = params::InterfaceGl( "Menue Window", Vec2i(300, 400 ), ColorA(0.5,0.5,0.5,0.1) ); menueBar.setOptions("", "text=light position='724 0' valueswidth=100 contained=true"); menueBar.addButton("Clear Scene ", std::bind( &ForelleVisualAppApp::clearScene, this ) ); menueBar.addButton("Delete Selected Cluster", std::bind( &ForelleVisualAppApp::deleteCluster, this ) ); menueBar.addParam("Draw Grid" , &drawGrid,""); menueBar.addParam("Read Pixel" , &readPixels, "true=reading false='not reading'"); menueBar.addButton("Refresh ClusterBar", std::bind( &ForelleVisualAppApp::refreshClusterBar, this ) ); menueBar.addParam("Update Cluster" , &updateCluster,"true=updating false='not updating'"); menueBar.addParam("Send only Selected Cluster" , &selectedClusterOn,""); menueBar.addSeparator(); menueBar.addButton("Load Scene ", std::bind( &ForelleVisualAppApp::loadScene, this ) ); menueBar.addButton("Load Cluster to Universe ", std::bind( &ForelleVisualAppApp::loadClusterToUniverse, this ) ); menueBar.addParam(" Load to Universe" , &templateUniverse,"min=0 max=3 step=1"); menueBar.addButton("Save as Cluster", std::bind( &ForelleVisualAppApp::saveAsCluster, this ) ); menueBar.addButton("Save as Scene", std::bind( &ForelleVisualAppApp::saveAsScene, this ) ); menueBar.addButton("Save as Standart Scene", std::bind( &ForelleVisualAppApp::saveAsStandartScene, this ) ); menueBar.addParam("Send Data" , &sendData,"true=sending false='not sending'"); menueBar.addSeparator(); menueBar.addSeparator(); menueBar.addParam("All On" , &bAllOn,""); menueBar.addParam("All Off" , &bAllOff,""); menueBar.addButton("Show ClusterBar", std::bind( &ForelleVisualAppApp::showClusterBar, this ) ); menueBar.show(false); for (int i=0; i < Const::MAX_DMX_CHANNELS ; i++) { data1[i]= 0; data2[i]= 0; data3[i]= 0; data4[i]= 0; } //setup boolean variables readPixels = true; sendData = true; drawGrid = true; updateCluster = true; bAllOn = false; bAllOff = false; bShowClusterBar = false; selectedClusterOn = false; //default load out templates to universe 0 templateUniverse = 0; // set our pointer to the last added cluster if(!clusters.empty()) selectedCluster = clusters.end()-1; controller.printClusters(clusters); //Setup Artnetnode if(ipAdress.empty() ) ipAdress = "10.0.2.1"; //if it isn´t initalised already node = CinderArtnet("Art-Net Test", "LongName", ipAdress); node.setNodeTypeAsServer(); node.setSubnetAdress(0); node.enableDMXPortAsInputAndSetAdress(0,1); node.enableDMXPortAsInputAndSetAdress(1, 2); node.enableDMXPortAsInputAndSetAdress(2, 3); node.enableDMXPortAsInputAndSetAdress(3, 4); node.printConfig(); node.startNode(); // initalize start our Syphone Client client.setup(Vec2i(60,60)); pos = Vec2i(0,0); scale = 9; mLogo = gl::Texture( loadImage( loadResource(RES_LOGO) ) ); }
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; } } }