{"id":426,"date":"2013-08-07T13:52:33","date_gmt":"2013-08-07T13:52:33","guid":{"rendered":"http:\/\/strikelimit.co.uk\/m\/?p=426"},"modified":"2013-08-07T13:52:33","modified_gmt":"2013-08-07T13:52:33","slug":"using-awesomium-with-monogame-backspace","status":"publish","type":"post","link":"http:\/\/strikelimit.co.uk\/m\/?p=426","title":{"rendered":"Using Awesomium with MonoGame &#8211; Backspace"},"content":{"rendered":"<p>A problem with the code presented in my previous post is that it won&#8217;t work with the special case of the <em>Backspace<\/em> key, however it can still be handled with a few small additions, based on the code I found <a title=\"A related question on the Awesomium forum\" href=\"http:\/\/answers.awesomium.com\/questions\/1483\/how-to-inject-tab-into-webcontrol.html\">in this question<\/a> on the Awesomium forums. I have changed my code to the following:<\/p>\n<p><!--more--><\/p>\n<pre lang=\"CSHARP\">\r\n    WebKeyboardEvent webKeyboardEvent = new WebKeyboardEvent();\r\n    if (character == '\\b')\r\n    {\r\n        webKeyboardEvent.Type = WebKeyboardEventType.KeyDown;\r\n        webKeyboardEvent.VirtualKeyCode = VirtualKey.BACK;\r\n        webView.InjectKeyboardEvent(webKeyboardEvent);\r\n        webKeyboardEvent.Type = WebKeyboardEventType.KeyUp;\r\n        webView.InjectKeyboardEvent(webKeyboardEvent);\r\n    }\r\n    else\r\n    {\r\n        webKeyboardEvent.Type = WebKeyboardEventType.Char;\r\n        webKeyboardEvent.Text = new String(new char[] { character, (char)0, (char)0, (char)0 });\r\n        webView.InjectKeyboardEvent(webKeyboardEvent);\r\n    }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A problem with the code presented in my previous post is that it won&#8217;t work with the special case of the Backspace key, however it can still be handled with a few small additions, based on the code I found in this question on the Awesomium forums. I have changed my code to the following:<\/p><p><a class=\"more-link btn\" href=\"http:\/\/strikelimit.co.uk\/m\/?p=426\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53,3],"tags":[54,4,21,55,56,42,11],"_links":{"self":[{"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/posts\/426"}],"collection":[{"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=426"}],"version-history":[{"count":1,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/posts\/426\/revisions"}],"predecessor-version":[{"id":427,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=\/wp\/v2\/posts\/426\/revisions\/427"}],"wp:attachment":[{"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/strikelimit.co.uk\/m\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}