| OLD | NEW |
| 1 <html><head> | 1 <html><head> |
| 2 <meta http-equiv="content-type" content="text/html; charset=utf-8"> | 2 <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
| 3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
| 4 var defaultActions = { | 4 var defaultActions = { |
| 5 'keydown': true, | 5 'keydown': true, |
| 6 'keypress': true, | 6 'keypress': true, |
| 7 'keyup': true, | 7 'keyup': true, |
| 8 'textInput': true, | 8 'textInput': true, |
| 9 }; | 9 }; |
| 10 var keyEventResult = []; | 10 var keyEventResult = []; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (evt.type == 'textInput') { | 65 if (evt.type == 'textInput') { |
| 66 result += evt.data; | 66 result += evt.data; |
| 67 } else { | 67 } else { |
| 68 // On Linux, the keydown event of a modifier key doesn't have the | 68 // On Linux, the keydown event of a modifier key doesn't have the |
| 69 // corresponding modifier attribute set, while the keyup event does have, | 69 // corresponding modifier attribute set, while the keyup event does have, |
| 70 // eg. pressing and releasing ctrl may generate a keydown event with | 70 // eg. pressing and releasing ctrl may generate a keydown event with |
| 71 // ctrlKey=false and a keyup event with ctrlKey=true. | 71 // ctrlKey=false and a keyup event with ctrlKey=true. |
| 72 // But Windows and Mac have opposite behavior than Linux. | 72 // But Windows and Mac have opposite behavior than Linux. |
| 73 // To make the C++ testing code simpler, if it's a modifier key event, | 73 // To make the C++ testing code simpler, if it's a modifier key event, |
| 74 // then ignores the corresponding modifier attribute by setting it to true. | 74 // then ignores the corresponding modifier attribute by setting it to true. |
| 75 var keyId = evt.keyIdentifier; | 75 var keyId = evt.key; |
| 76 result += (evt.keyCode + ' ' + evt.charCode + ' ' + | 76 result += (evt.keyCode + ' ' + evt.charCode + ' ' + |
| 77 (keyId == 'Control' ? true : evt.ctrlKey) + ' ' + | 77 (keyId == 'Control' ? true : evt.ctrlKey) + ' ' + |
| 78 (keyId == 'Shift' ? true : evt.shiftKey) + ' ' + | 78 (keyId == 'Shift' ? true : evt.shiftKey) + ' ' + |
| 79 (keyId == 'Alt' ? true : evt.altKey) + ' ' + | 79 (keyId == 'Alt' ? true : evt.altKey) + ' ' + |
| 80 (keyId == 'Meta' ? true : evt.metaKey)); | 80 (keyId == 'Meta' ? true : evt.metaKey)); |
| 81 } | 81 } |
| 82 keyEventResult.push(result); | 82 keyEventResult.push(result); |
| 83 log(result); | 83 log(result); |
| 84 | 84 |
| 85 if (testStarted) { | 85 if (testStarted) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 <input type="checkbox" id="D" accesskey='D' | 165 <input type="checkbox" id="D" accesskey='D' |
| 166 onfocus="onFocus(this)" onblur="onBlur(this)"/> | 166 onfocus="onFocus(this)" onblur="onBlur(this)"/> |
| 167 <input type="text" id="A" accesskey="A" | 167 <input type="text" id="A" accesskey="A" |
| 168 onfocus="onFocus(this)" onblur="onBlur(this)"/> | 168 onfocus="onFocus(this)" onblur="onBlur(this)"/> |
| 169 <input type="password" id="B" accesskey="B" | 169 <input type="password" id="B" accesskey="B" |
| 170 onfocus="onFocus(this)" onblur="onBlur(this)"/> | 170 onfocus="onFocus(this)" onblur="onBlur(this)"/> |
| 171 <button id="clear" accesskey='C' onclick="clearResult()">Clear</button> | 171 <button id="clear" accesskey='C' onclick="clearResult()">Clear</button> |
| 172 <p id="log"></p> | 172 <p id="log"></p> |
| 173 </body> | 173 </body> |
| 174 </html> | 174 </html> |
| OLD | NEW |