- void OnKeyEvent(const KeyEvent& event)
- {
- if(event.state == KeyEvent::Down)
- {
- if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
- {
- mApplication.Quit();
- }
- else
- {
- const char* keyName = event.keyPressedName.c_str();
- if( strcmp(keyName, "Left") == 0 )
- {
- mScale /= 1.1f;
- for( unsigned int i=0; i<4u; i++)
- {
- mSvgActor[i].SetSize( mActorSize * mScale);
- }
- }
- else if( strcmp(keyName, "Right") == 0 )
- {
- if( mScale < MAX_SCALE )
- {
- mScale *= 1.1f;
- }
- for( unsigned int i=0; i<4u; i++)
- {
- mSvgActor[i].SetSize( mActorSize * mScale);
- }
- }
- }
- }
- }
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.GetState() == KeyEvent::DOWN)
+ {
+ if(IsKey(event, Dali::DALI_KEY_ESCAPE) || IsKey(event, Dali::DALI_KEY_BACK))
+ {
+ mApplication.Quit();
+ }
+ else
+ {
+ const char* keyName = event.GetKeyName().c_str();
+ if(strcmp(keyName, "Left") == 0)
+ {
+ if(mScale > MIN_SCALE)
+ {
+ mScale /= 1.1f;
+ }
+ for(unsigned int i = 0; i < NUM_IMAGES_DISPLAYED; i++)
+ {
+ mSvgActor[i].SetProperty(Actor::Property::SIZE, mActorSize * mScale);
+ }
+ }
+ else if(strcmp(keyName, "Right") == 0)
+ {
+ if(mScale < MAX_SCALE)
+ {
+ mScale *= 1.1f;
+ }
+ for(unsigned int i = 0; i < NUM_IMAGES_DISPLAYED; i++)
+ {
+ mSvgActor[i].SetProperty(Actor::Property::SIZE, mActorSize * mScale);
+ }
+ }
+ }
+ }
+ }