| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 // TODO(elichtenberg): Move into custom logger class or somewhere else. | 5 // TODO(elichtenberg): Move into custom logger class or somewhere else. |
| 6 let debuggingEnabled = true; | 6 let debuggingEnabled = true; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Class to handle keyboard input. | 9 * Class to handle keyboard input. |
| 10 * | 10 * |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 switch (event.key) { | 41 switch (event.key) { |
| 42 case '1': | 42 case '1': |
| 43 console.log('1 = go to next element'); | 43 console.log('1 = go to next element'); |
| 44 this.switchAccess_.moveToNode(true); | 44 this.switchAccess_.moveToNode(true); |
| 45 break; | 45 break; |
| 46 case '2': | 46 case '2': |
| 47 console.log('2 = go to previous element'); | 47 console.log('2 = go to previous element'); |
| 48 this.switchAccess_.moveToNode(false); | 48 this.switchAccess_.moveToNode(false); |
| 49 break; | 49 break; |
| 50 case '3': | 50 case '3': |
| 51 console.log('3 = do default on element'); | 51 console.log('3 = select element'); |
| 52 this.switchAccess_.doDefault(); | 52 this.switchAccess_.selectCurrentNode(); |
| 53 break; | 53 break; |
| 54 case '4': | 54 case '4': |
| 55 this.switchAccess_.showOptionsPage(); | 55 this.switchAccess_.showOptionsPage(); |
| 56 break; | 56 break; |
| 57 } | 57 } |
| 58 if (debuggingEnabled) { | 58 if (debuggingEnabled) { |
| 59 switch (event.key) { | 59 switch (event.key) { |
| 60 case '6': | 60 case '6': |
| 61 console.log('6 = go to next element (debug mode)'); | 61 console.log('6 = go to next element (debug mode)'); |
| 62 this.switchAccess_.debugMoveToNext(); | 62 this.switchAccess_.debugMoveToNext(); |
| 63 break; | 63 break; |
| 64 case '7': | 64 case '7': |
| 65 console.log('7 = go to previous element (debug mode)'); | 65 console.log('7 = go to previous element (debug mode)'); |
| 66 this.switchAccess_.debugMoveToPrevious(); | 66 this.switchAccess_.debugMoveToPrevious(); |
| 67 break; | 67 break; |
| 68 case '8': | 68 case '8': |
| 69 console.log('8 = go to child element (debug mode)'); | 69 console.log('8 = go to child element (debug mode)'); |
| 70 this.switchAccess_.debugMoveToFirstChild(); | 70 this.switchAccess_.debugMoveToFirstChild(); |
| 71 break; | 71 break; |
| 72 case '9': | 72 case '9': |
| 73 console.log('9 = go to parent element (debug mode)'); | 73 console.log('9 = go to parent element (debug mode)'); |
| 74 this.switchAccess_.debugMoveToParent(); | 74 this.switchAccess_.debugMoveToParent(); |
| 75 break; | 75 break; |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 this.switchAccess_.performedUserAction(); | 78 this.switchAccess_.performedUserAction(); |
| 79 } | 79 } |
| 80 }; | 80 }; |
| OLD | NEW |