By default Delphi XE5 Firemonkey doesn’t bring up the virtual keyboard when you tap an edit field inside of a TWebBrowser. This can be a problem if you are attempting to create an HTML5 app using the TWebBrowser control. The reason why this is the case is because TWebBrowser is actually wraps around a native Android control called a WebView that is floating over the top of the TForm. Someone came up with a fix that will allow the virtual keyboard to come up over on Stackoverflow. Another possible fix is to just use a Javascipt based virtual keyboard on the page you are viewing TWebBrowser with. The root of the fix is to allow the TWebBrowser control to get focus using:
procedure TFormBrowserAdd.ButtonNavigateClick(Sender: TObject); begin WebBrowser.CanFocus := True; WebBrowser.Navigate(EditUrl.Text); WebBrowser.SetFocus; end;
When you are done with the virtual keyboard you can also set the focus back to your form which may take care of some other issues like not being able to use the virtual keyboard in the rest of your form afterwards.
Head over to Stackoverflow to read the full discussion.
Good afternoon, where should this code go?, Because I can not find where to put it. thank you very much!
You should run the SetFocus after you call Navigate() to your URL. WebBrowser.CanFocus := True; allows it to take focus. WebBrowser.Navigate(EditUrl.Text); navigates to the URL you want. WebBrowser.SetFocus; sets the focus to the WebBrowser control.