I have been successful in sending a a letter (or text string using this syntax):
chrome.debugger.sendCommand({ tabId: tabs[0].id },'Input.dispatchKeyEvent',{ type: 'keyDown', text: "b", isKeypad: true });
And this would be fine for most of my needs but I really want to be able to send special characters like tab. The first step would be for me to be able to send a character using the parameters like the windowsVirtualKeyCode or nativeVirtualKeyCode but when I replace the line above with something like this I don't get any response.
chrome.debugger.sendCommand({ tabId: tabs[0].id },'Input.dispatchKeyEvent',{ type: 'keyDown', windowsVirtualKeyCode: 66, nativeVirtualKeyCode: 66, isKeypad: true });
I'm not sure why the code at the top works and the bottom does not. Perhaps I am using the wrong decimal for the letter b. Or more likely I am missing a parameter that is needed. My ultimate goal after verifying that I can write a windowsVirtualKeyCode: 0x42 successfully will be to then send a tab character which I am thinking will be a decimal value of 9.
I can't figure out where my second line is not producing the same response when in place of the top line which is working.
Below function will press Tab key :-