Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/resources/vr_shell/vk.js

Issue 2647053002: Add initial VR interactive omnibox. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698