539 void CVideoPlaybackControlsTest::TapOnScreen( TPointerEvent::TType aType, |
539 void CVideoPlaybackControlsTest::TapOnScreen( TPointerEvent::TType aType, |
540 TPoint aPosition ) |
540 TPoint aPosition ) |
541 { |
541 { |
542 MPX_DEBUG(_L("CVideoPlaybackControlsTest::TapOnScreen()")); |
542 MPX_DEBUG(_L("CVideoPlaybackControlsTest::TapOnScreen()")); |
543 |
543 |
|
544 MPX_DEBUG(_L(" aType = %d, aPosition = (%d,%d)"), aType, aPosition.iX, aPosition.iY); |
|
545 |
|
546 TPoint tapPoint( aPosition ); |
|
547 |
|
548 #if !defined(__WINS__) |
|
549 |
|
550 // |
|
551 // On the hardware, the window server is performing a rotation. |
|
552 // This calculation will adjust the points so the same touch point is received |
|
553 // on both the emulator and hardware |
|
554 // |
|
555 // ix = ( ScreenWidth - 1 ) - oldPosition.iY - YOffset |
|
556 // I am not sure why they subtract 1 from the screen width, but they do |
|
557 // The YOffset can be read from the wsini.ini file |
|
558 // |
|
559 // iy = oldPosition.iX |
|
560 // |
|
561 tapPoint.iX = ( 360 - 1 ) - aPosition.iY - 12; |
|
562 tapPoint.iY = aPosition.iX; |
|
563 |
|
564 #endif |
|
565 |
|
566 MPX_DEBUG(_L(" tapPosition = (%d,%d)"), tapPoint.iX, tapPoint.iY); |
|
567 |
544 TRawEvent pointer; |
568 TRawEvent pointer; |
545 |
569 |
546 if ( aType == TPointerEvent::EButton1Down ) |
570 if ( aType == TPointerEvent::EButton1Down ) |
547 { |
571 { |
548 pointer.Set( TRawEvent::EButton1Down, aPosition.iX, aPosition.iY ); |
572 pointer.Set( TRawEvent::EButton1Down, tapPoint.iX, tapPoint.iY ); |
549 |
573 |
550 iWsSession.SimulateRawEvent( pointer ); |
574 iWsSession.SimulateRawEvent( pointer ); |
551 iWsSession.Flush(); |
575 iWsSession.Flush(); |
552 } |
576 } |
553 else if ( aType == TPointerEvent::EButton1Up ) |
577 else if ( aType == TPointerEvent::EButton1Up ) |
554 { |
578 { |
555 pointer.Set( TRawEvent::EButton1Up, aPosition.iX, aPosition.iY ); |
579 pointer.Set( TRawEvent::EButton1Up, tapPoint.iX, tapPoint.iY ); |
556 |
580 |
557 iWsSession.SimulateRawEvent( pointer ); |
581 iWsSession.SimulateRawEvent( pointer ); |
558 iWsSession.Flush(); |
582 iWsSession.Flush(); |
559 } |
583 } |
560 } |
584 } |