MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / keyPressed

Method keyPressed

Samples/2.0/Common/src/System/Desktop/UnitTesting.cpp:318–344  ·  view source on GitHub ↗

-------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

316 }
317 //-------------------------------------------------------------------------
318 void UnitTest::keyPressed( const SDL_KeyboardEvent &arg )
319 {
320 if( !mParams.isPlayback() )
321 {
322 if( arg.keysym.sym == SDLK_F12 || arg.keysym.sym == SDLK_PRINTSCREEN )
323 {
324 // Ignore (see keyReleased)
325 }
326 else if( shouldRecordKey( arg ) )
327 {
328 if( mFrameActivity.empty() || mFrameActivity.back().frameId != mFrameIdx )
329 mFrameActivity.push_back( FrameActivity( mFrameIdx ) );
330
331 KeyStroke keyStroke;
332 keyStroke.keycode = arg.keysym.sym;
333 keyStroke.scancode = arg.keysym.scancode;
334 keyStroke.bReleased = arg.type == SDL_KEYUP;
335 mFrameActivity.back().keyStrokes.push_back( keyStroke );
336 }
337 }
338
339 if( !mBlockInputForwarding )
340 {
341 // Forward to application
342 mRealKeyboardListener->keyPressed( arg );
343 }
344 }
345 //-------------------------------------------------------------------------
346 void UnitTest::keyReleased( const SDL_KeyboardEvent &arg )
347 {

Callers

nothing calls this directly

Calls 5

FrameActivityClass · 0.85
isPlaybackMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected