From f293f9759dc3e28b283301ec0227537ec2ca2d2b Mon Sep 17 00:00:00 2001 From: anthony taranto Date: Mon, 5 Mar 2012 14:08:11 -0800 Subject: [PATCH] implement IKeyboardInputSink --- CefSharp.Wpf/WebView.cpp | 2 +- CefSharp.Wpf/WebView.h | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CefSharp.Wpf/WebView.cpp b/CefSharp.Wpf/WebView.cpp index d3a9ef6d9..c9acbf326 100644 --- a/CefSharp.Wpf/WebView.cpp +++ b/CefSharp.Wpf/WebView.cpp @@ -67,7 +67,7 @@ namespace Wpf IntPtr WebView::SourceHook(IntPtr hWnd, int message, IntPtr wParam, IntPtr lParam, bool% handled) { handled = false; - + switch(message) { case WM_KEYDOWN: diff --git a/CefSharp.Wpf/WebView.h b/CefSharp.Wpf/WebView.h index 269baaa25..722b030cc 100644 --- a/CefSharp.Wpf/WebView.h +++ b/CefSharp.Wpf/WebView.h @@ -22,7 +22,8 @@ namespace CefSharp namespace Wpf { [TemplatePart(Name="PART_Browser", Type=Image::typeid)] - public ref class WebView sealed : public ContentControl, IRenderWebBrowser + public ref class WebView sealed : public ContentControl, + IRenderWebBrowser, IKeyboardInputSink { private: delegate void ActionDelegate(); @@ -184,5 +185,42 @@ namespace Wpf virtual void OnApplyTemplate() override; virtual void SetCursor(CefCursorHandle cursor); virtual void SetBuffer(int width, int height, const void* buffer); + + // IKeyboadInputSink + virtual property IKeyboardInputSite^ KeyboardInputSite + { + IKeyboardInputSite^ get() { return nullptr; } + void set(IKeyboardInputSite^ site) { } + } + + virtual bool HasFocusWithin() + { + return false; + } + + virtual bool OnMnemonic(System::Windows::Interop::MSG% msg, System::Windows::Input::ModifierKeys modifiers) + { + return false; + } + + virtual bool TranslateAccelerator(System::Windows::Interop::MSG% msg, System::Windows::Input::ModifierKeys modifiers) + { + return false; + } + + virtual bool TranslateChar(System::Windows::Interop::MSG% msg, System::Windows::Input::ModifierKeys modifiers) + { + return false; + } + + virtual IKeyboardInputSite^ RegisterKeyboardInputSink(IKeyboardInputSink^ sink) + { + return nullptr; + } + + virtual bool TabInto(TraversalRequest^ request) + { + return false; + } }; }} \ No newline at end of file