how to create a custom keyboard handler

547 views
Skip to first unread message

Tyler Jones

unread,
Aug 18, 2015, 1:10:42 PM8/18/15
to CefSharp
I'm using the NuGet Winforms package, and I'm trying to create a keyboard handler.
When I look at the winforms example, there is a keyboard handler class with a method that requires an IBrowser parameter.  However, IBrowser is not installed with the NuGet package.  If I try to create my own class called IBrowser and implement it from the example, IBrowser depends on many other interfaces which are also not included, and which also depend on interfaces which are not included.
I'm creating the keyboard handler, because I want the container form to receive keyboard input, so that I can do things like call up the devtools with a keyboard shortcut.

TL;DR  If I try to use the winforms example keyboard handler, it sends me on a rabbit trail of missing interfaces.  Do I have to create all of the classes that are missing in order to create a keyboard handler?  Or is there an easier way?

Alex Maitland

unread,
Aug 18, 2015, 5:08:12 PM8/18/15
to CefSharp
The latest nuget package is based on this branch https://github.com/cefsharp/CefSharp/tree/cefsharp/41

`master` is the current development branch and is the basis of the next version.

Tyler Jones

unread,
Aug 18, 2015, 5:33:04 PM8/18/15
to cefs...@googlegroups.com
Perfect!  The keyboard handler from the branch works correctly.  Now, what about a requesthandler?  I'm also needing to do the no-cache thing described here:  https://groups.google.com/forum/#!searchin/cefsharp/cache/cefsharp/vsSIxvCy3mU/PI9XaVb9iy8J
I see the winforms example in branch 41 assigns a requesthandler, but I can't find the actual request handler class to give me an example of how to implement it.



--
You received this message because you are subscribed to a topic in the Google Groups "CefSharp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cefsharp/o3iM9_zU2fA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp.
For more options, visit https://groups.google.com/d/optout.

Alex Maitland

unread,
Aug 18, 2015, 6:05:11 PM8/18/15
to CefSharp
If you open the solution in visual studio you should have no problems navigating to the class implementations.

There are a number of examples commonly used between the different projects see
https://github.com/cefsharp/CefSharp/tree/cefsharp/41/CefSharp.Example
Reply all
Reply to author
Forward
0 new messages