| OLD | NEW |
| 1 vk_l_panel_layout = [ | 1 vk_l_panel_layout = [ |
| 2 [ | 2 [ |
| 3 { "code": "Key1", "key": "1" }, | 3 { "code": "Key1", "key": "1" }, |
| 4 { "code": "Key2", "key": "2" }, | 4 { "code": "Key2", "key": "2" }, |
| 5 { "code": "Key3", "key": "3" }, | 5 { "code": "Key3", "key": "3" }, |
| 6 ], | 6 ], |
| 7 [ | 7 [ |
| 8 { "code": "Key4", "key": "4" }, | 8 { "code": "Key4", "key": "4" }, |
| 9 { "code": "Key5", "key": "5" }, | 9 { "code": "Key5", "key": "5" }, |
| 10 { "code": "Key6", "key": "6" }, | 10 { "code": "Key6", "key": "6" }, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 function vk_level0(button) { | 211 function vk_level0(button) { |
| 212 vk_ch(button); | 212 vk_ch(button); |
| 213 vk_activate_level(0); | 213 vk_activate_level(0); |
| 214 } | 214 } |
| 215 | 215 |
| 216 function vk_ch(button) { | 216 function vk_ch(button) { |
| 217 if (button.key || button.code) { | 217 if (button.key || button.code) { |
| 218 console.log('Keyboard click: ' + performance.now()); | 218 console.log('Keyboard click: ' + performance.now()); |
| 219 // Hack! Set focus back to omnibox. Oh man... | 219 document.querySelector("#omnibox-input-field").focus(); |
| 220 let field = document.querySelector("#input-field"); | |
| 221 field.focus();; | |
| 222 sendKey('key', button.code, button.key); | 220 sendKey('key', button.code, button.key); |
| 223 if (vk_state.level == 1) | 221 if (vk_state.level == 1) |
| 224 vk_activate_level(0); | 222 vk_activate_level(0); |
| 225 console.log('Done keyboard click: ' + performance.now()); | 223 console.log('Done keyboard click: ' + performance.now()); |
| 226 } | 224 } |
| 227 } | 225 } |
| 228 | 226 |
| 229 function vk_ignore(button) { | 227 function vk_ignore(button) { |
| 230 } | 228 } |
| 231 | 229 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 charValue: ch, | 478 charValue: ch, |
| 481 keyCode: vk, | 479 keyCode: vk, |
| 482 keyName: code, | 480 keyName: code, |
| 483 modifiers: modifiers | 481 modifiers: modifiers |
| 484 }; | 482 }; |
| 485 //chrome.virtualKeyboardPrivate.sendKeyEvent(event, logIfError_); | 483 //chrome.virtualKeyboardPrivate.sendKeyEvent(event, logIfError_); |
| 486 console.log('KEY: t: ' + type + ' ch: ' +ch + ' kc: ' + vk +' kn: '+ code+ ' m
: ' + modifiers); | 484 console.log('KEY: t: ' + type + ' ch: ' +ch + ' kc: ' + vk +' kn: '+ code+ ' m
: ' + modifiers); |
| 487 api.doAction(api.Action.KEY_EVENT, event); | 485 api.doAction(api.Action.KEY_EVENT, event); |
| 488 } | 486 } |
| 489 | 487 |
| OLD | NEW |