OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Provides a compatibility layer for ChromeVox Classic during the | 6 * @fileoverview Provides a compatibility layer for ChromeVox Classic during the |
7 * transition to ChromeVox Next. | 7 * transition to ChromeVox Next. |
8 */ | 8 */ |
9 | 9 |
10 goog.provide('ClassicCompatibility'); | 10 goog.provide('ClassicCompatibility'); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 break; | 86 break; |
87 case 'Shift': | 87 case 'Shift': |
88 evt.shiftKey = true; | 88 evt.shiftKey = true; |
89 break; | 89 break; |
90 case 'Alt': | 90 case 'Alt': |
91 evt.altKey = true; | 91 evt.altKey = true; |
92 break; | 92 break; |
93 case 'Search': | 93 case 'Search': |
94 evt.searchKeyHeld = true; | 94 evt.searchKeyHeld = true; |
95 break; | 95 break; |
| 96 case 'Space': |
| 97 evt.keyCode = 32; |
| 98 break; |
96 case 'Left Arrow': | 99 case 'Left Arrow': |
| 100 evt.keyCode = 37; |
| 101 break; |
| 102 case 'Up Arrow': |
97 evt.keyCode = 38; | 103 evt.keyCode = 38; |
98 break; | 104 break; |
99 case 'Right Arrow': | 105 case 'Right Arrow': |
| 106 evt.keyCode = 39; |
| 107 break; |
| 108 case 'Down Arrow': |
100 evt.keyCode = 40; | 109 evt.keyCode = 40; |
101 break; | 110 break; |
102 default: | 111 default: |
103 evt.keyCode = token.charCodeAt(0); | 112 evt.keyCode = token.charCodeAt(0); |
104 } | 113 } |
105 }); | 114 }); |
106 | 115 |
107 return evt; | 116 return evt; |
108 }, | 117 }, |
109 | 118 |
110 /** | 119 /** |
111 * Maps a Classic command to an approximate equivalent in Next. | 120 * Maps a Classic command to an approximate equivalent in Next. |
112 * @param {string} classicCommand | 121 * @param {string} classicCommand |
113 * @return {string} | 122 * @return {string} |
114 * @private | 123 * @private |
115 */ | 124 */ |
116 getNextCommand_: function(classicCommand) { | 125 getNextCommand_: function(classicCommand) { |
117 switch (classicCommand) { | 126 switch (classicCommand) { |
118 case 'right': | 127 case 'right': |
| 128 return 'nextElement'; |
119 case 'forward': | 129 case 'forward': |
120 return 'nextElement'; | 130 return 'nextLine'; |
121 case 'left': | 131 case 'left': |
| 132 return 'previousElement'; |
122 case 'backward': | 133 case 'backward': |
123 return 'previousElement'; | 134 return 'previousLine'; |
| 135 case 'forceClickOnCurrentItem': |
| 136 return 'doDefault'; |
124 default: | 137 default: |
125 return classicCommand; | 138 return classicCommand; |
126 } | 139 } |
127 } | 140 } |
128 }; | 141 }; |
OLD | NEW |