c# - Send a key to WebView -


short version: possible send key press event embedded webview in windows phone?

long version: have simple html5 game hosted on website , want load inside website in windows phone app , add control keys (e.g. left, right, shoot) button of screen. , then, if user pressed left button, send left key webview. possible achieve this?

javascript can executed in webview using webview.invokescriptasync. should able use call same javascript event handler methods use key events.

also note invokescriptasync invokes single javascript function, if need execute arbitrary number of statements, neat trick use eval. example:

var script = "..."; await webview.invokescriptasync("eval", new string[] { script });