MCPcopy Create free account
hub / github.com/cinder/Cinder / keyDown

Method keyDown

test/AppTest/src/AppTestApp.cpp:150–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void AppTestApp::keyDown( KeyEvent event )
151{
152 if( event.getChar() == 'f' ) {
153 setFullScreen( ! isFullScreen() );
154 }
155 else if( event.getChar() == 'o' ) {
156 auto filePath = getOpenFilePath();
157 CI_LOG_I( "result of getOpenFilePath(): " << filePath );
158 }
159 else if( event.getChar() == 'p' ) {
160 auto filePath = getFolderPath();
161 CI_LOG_I( "result of getFolderPath(): " << filePath );
162 }
163 else if( event.getChar() == 's' ) {
164 auto filePath = getSaveFilePath();
165 CI_LOG_I( "result of getSaveFilePath(): " << filePath );
166 }
167 else if( event.getChar() == 'r' ) {
168 // iterate through some framerate settings
169 int targetFrameRate = (int)lround( getFrameRate() );
170 if( ! isFrameRateEnabled() ) {
171 CI_LOG_I( "setting framerate to 60" );
172 setFrameRate( 60 );
173 }
174 else if( targetFrameRate == 60 ) {
175 CI_LOG_I( "setting framerate to 30" );
176 setFrameRate( 30 );
177 }
178 else if( targetFrameRate == 30 ) {
179 CI_LOG_I( "disabling framerate" );
180 disableFrameRate();
181 }
182 else {
183 CI_ASSERT_NOT_REACHABLE();
184 }
185 }
186 else if( event.getChar() == 'v' ) {
187 gl::enableVerticalSync( ! gl::isVerticalSyncEnabled() );
188 }
189}
190
191void AppTestApp::mouseDown( MouseEvent event )
192{

Callers

nothing calls this directly

Calls 10

setFullScreenFunction · 0.85
isFullScreenFunction · 0.85
getOpenFilePathFunction · 0.85
getSaveFilePathFunction · 0.85
lroundFunction · 0.85
getFrameRateFunction · 0.85
isFrameRateEnabledFunction · 0.85
setFrameRateFunction · 0.85
enableVerticalSyncFunction · 0.85
isVerticalSyncEnabledFunction · 0.85

Tested by

no test coverage detected