Update contrib.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\device\t_keyboardrotate.cpp
15 // Keyboard Rotation test file
22 #include <e32event_private.h>
25 //---------------------------------------------
26 //! @SYMTestCaseID PBASE_KEYBOARDROTATE
28 //! @SYMTestCaseDesc Manual test of keyboard rotation modifiers.
29 //! @SYMREQ CR - APOS-666C3S
30 //! @SYMTestActions Select each of 4 possible keyboard rotations and verify correct behaviour.
31 //! @SYMTestExpectedResults The described section of the keyboard is rotated as displayed by the test.
32 //! @SYMTestPriority High
33 //---------------------------------------------
35 LOCAL_D RTest test(_L("T_KEYBOARDROTATE"));
37 GLDEF_C TInt E32Main()
41 test.Start(_L("Test Keyboard Rotation Modifiers\n"));
42 test.Printf(_L("The following 3x3 grid of keys can be rotated: \n\n"));
43 test.Printf(_L("Q W E\n\n"));
44 test.Printf(_L("A S D\n\n"));
45 test.Printf(_L("Z X C\n\n"));
51 HAL::Get(HAL::EMachineUid, machineuid);
52 if(machineuid != HAL::EMachineUid_Lubbock && machineuid != HAL::EMachineUid_Win32Emulator)
54 test.Printf(_L("Test only supports Lubbock platform and emulator\n"));
61 test.Printf(_L("Select desired option: \n\n"));
62 test.Printf(_L("(1) Rotate 90 deg clockwise\n"));
63 test.Printf(_L("(2) Rotate 180 deg clockwise\n"));
64 test.Printf(_L("(3) Rotate 270 deg clockwise\n"));
65 test.Printf(_L("(4) Return to default layout\n\n"));
66 test.Printf(_L("Press any other key to exit\n\n"));
68 response=test.Getch();
70 switch((TInt)response)
73 event.Set(TRawEvent::EUpdateModifiers, EModifierRotateBy90);
74 UserSvr::AddEvent(event);
75 test.Printf(_L("The keyboard layout is now as follows: \n\n"));
76 test.Printf(_L("Z A Q\n\n"));
77 test.Printf(_L("X S W\n\n"));
78 test.Printf(_L("C D E\n\n"));
82 event.Set(TRawEvent::EUpdateModifiers, EModifierRotateBy180);
83 UserSvr::AddEvent(event);
84 test.Printf(_L("The keyboard layout is now as follows: \n\n"));
85 test.Printf(_L("C X Z\n\n"));
86 test.Printf(_L("D S A\n\n"));
87 test.Printf(_L("E W Q\n\n"));
91 event.Set(TRawEvent::EUpdateModifiers, EModifierRotateBy270);
92 UserSvr::AddEvent(event);
93 test.Printf(_L("The keyboard layout is now as follows: \n\n"));
94 test.Printf(_L("E D C\n\n"));
95 test.Printf(_L("W S X\n\n"));
96 test.Printf(_L("Q A Z\n\n"));
100 event.Set(TRawEvent::EUpdateModifiers, EModifierCancelRotation);
101 UserSvr::AddEvent(event);
102 test.Printf(_L("The keyboard layout is now as follows: \n\n"));
103 test.Printf(_L("Q W E\n\n"));
104 test.Printf(_L("A S D\n\n"));
105 test.Printf(_L("Z X C\n\n"));
109 event.Set(TRawEvent::EUpdateModifiers, EModifierCancelRotation);
110 UserSvr::AddEvent(event);
115 test.Printf(_L("Test the new keyboard layout below and press enter when finished:\n"));
117 while(response!=EKeyEnter)
119 response=test.Getch();
120 test.Printf(TPtrC((TUint16 *)&response, 1));
123 test.Printf(_L("\n\n"));