Tab to recaptcha

前端 未结 2 1973
滥情空心
滥情空心 2021-01-27 15:17

Here\'s the scenario:

I\'m loading a page via a CefSharp browser. When the user clicks a certain button (on the form, not the web page) the page should then focus on the

2条回答
  •  遇见更好的自我
    2021-01-27 16:07

    I've tested KeyDown, KeyUp for Tab key and it works but to put a char in a input element we need to use KeyEventType.Char instead. even Tab key in this case act as text tab not for changing focus.

    KeyEvent key = new KeyEvent
    {
        WindowsKeyCode = 0x0D, // Enter you could use '(int)Keys.Enter'
        FocusOnEditableField = true,
        IsSystemKey = false,
        Type = KeyEventType.Char
    };
    
    
    _browser.GetBrowser().GetHost().SendKeyEvent(key);
    

提交回复
热议问题