Skip to content

Commit

Permalink
Update WebView.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
shen6041 committed Nov 11, 2013
1 parent b20b0d2 commit b121f93
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions CefSharp.Wpf/WebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,21 @@ namespace CefSharp

void WebView::OnPreviewKey(KeyEventArgs^ e)
{
CefRefPtr<CefBrowser> browser;
if (!TryGetCefBrowser(browser))
{
return;
}

if (e->Key == Key::Tab ||
e->Key >= Key::Left && e->Key <= Key::Down)
{
CefBrowser::KeyType type = e->IsDown ? KT_KEYDOWN : KT_KEYUP;
CefKeyInfo keyInfo;
keyInfo.key = KeyInterop::VirtualKeyFromKey(e->Key);
browser->SendKeyEvent(type, keyInfo, 0);

e->Handled = true;
}
CefRefPtr<CefBrowser> browser;
if (!TryGetCefBrowser(browser))
{
return;
}

if (e->Key == Key::Tab ||e->Key >= Key::Left && e->Key <= Key::Down)
{
CefBrowser::KeyType type = e->IsDown ? KT_KEYDOWN : KT_KEYUP;
CefKeyInfo keyInfo;
keyInfo.key = KeyInterop::VirtualKeyFromKey(e->Key);
browser->SendKeyEvent(type, keyInfo, 0);

e->Handled = true;
}
}

void WebView::OnPreviewTextInput(TextCompositionEventArgs^ e)
Expand Down

0 comments on commit b121f93

Please sign in to comment.