CEF stole my keyboard events!

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF stole my keyboard events!

Postby DavidSheth » Wed Mar 16, 2016 10:55 am

Hi everyone!
I'm using VB.NET and I'm new to both that and CEF.
I have the same problem as the one posted here: viewtopic.php?f=14&t=10805

The shortcut keys on my button items just do not seem to work like it did with the default WebBrowser1 provided by microsoft.

Apparently the solution is using CefKeyboardHandler but I don't know what that is or how to use it! :/

Help would be really appreciated! Thanks!
DavidSheth
Newbie
 
Posts: 9
Joined: Wed Mar 16, 2016 10:51 am

Re: CEF stole my keyboard events!

Postby amaitland » Wed Mar 16, 2016 5:36 pm

What CEF wrapper are you using? Best to ask on their forum to get an answer in context.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF stole my keyboard events!

Postby DavidSheth » Thu Mar 17, 2016 1:30 am

amaitland wrote:What CEF wrapper are you using? Best to ask on their forum to get an answer in context.

Thanks for the quick reply. Im using CEF for Winforms
DavidSheth
Newbie
 
Posts: 9
Joined: Wed Mar 16, 2016 10:51 am

Re: CEF stole my keyboard events!

Postby amaitland » Thu Mar 17, 2016 1:39 am

The three .Net wrappers I'm aware of are `CefSharp`, `CefGlue`, and `ChromiumFX`.

Unless you've wrapped `CEF` for use with `.Net` yourself?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF stole my keyboard events!

Postby DavidSheth » Thu Mar 17, 2016 4:34 am

Oh oh oh Okay!! >.< Im using CEF Sharp. Sorry, Im new to this...
DavidSheth
Newbie
 
Posts: 9
Joined: Wed Mar 16, 2016 10:51 am

Re: CEF stole my keyboard events!

Postby amaitland » Thu Mar 17, 2016 7:18 am

To use `CefKeyboardHandler`, you implement the `IKeyboardHandler` interface.

https://github.com/cefsharp/CefSharp/bl ... Handler.cs

Make sure to assign your new instance to the browser aka browser.KeyboardHandler = new KeyboardHandler();

The other option is to use follow http://www.magpcss.org/ceforum/viewtopi ... 805#p17413 see https://github.com/cefsharp/CefSharp/co ... d620d2f71d for an example (take the time to read over it carefully before asking any followup questions).

Best place to talk about cefsharp is on `Gitter`

https://gitter.im/cefsharp/CefSharp
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF stole my keyboard events!

Postby DavidSheth » Thu Mar 17, 2016 12:24 pm

amaitland wrote:To use `CefKeyboardHandler`, you implement the `IKeyboardHandler` interface.

https://github.com/cefsharp/CefSharp/bl ... Handler.cs

Make sure to assign your new instance to the browser aka browser.KeyboardHandler = new KeyboardHandler();

The other option is to use follow viewtopic.php?f=14&t=10805#p17413 see https://github.com/cefsharp/CefSharp/co ... d620d2f71d for an example (take the time to read over it carefully before asking any followup questions).

Best place to talk about cefsharp is on `Gitter`

https://gitter.im/cefsharp/CefSharp


Thanks again for your reply. Okay I added a new class IKeyboardHandler.vb (Visual Basic) and I've typed this after I create the browser
TorBrowser.KeyboardHandler = New KeyboardHandler
KeyboardHandler seems to be undefined and I dont know what to do!

Earlier I saw that thread, the one you posted.
I did set the runmutithread to false but that created some browser initialise errors so I don't think that would work
Could you please help me with the first one? Thanks!
DavidSheth
Newbie
 
Posts: 9
Joined: Wed Mar 16, 2016 10:51 am

Re: CEF stole my keyboard events!

Postby amaitland » Thu Mar 17, 2016 5:23 pm

The example projects demo lots of features. I cannot help you with VB.Net syntax, your on your own there.

https://github.com/cefsharp/CefSharp/bl ... rol.cs#L38

MultithreadedMessageLoop = false would likely give you the cleanest solution. I've never seen it cause errors before.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF stole my keyboard events!

Postby DavidSheth » Fri Mar 18, 2016 5:12 am

But what is KeyboardHandler? It's not yet defined! : (
DavidSheth
Newbie
 
Posts: 9
Joined: Wed Mar 16, 2016 10:51 am

Re: CEF stole my keyboard events!

Postby amaitland » Fri Mar 18, 2016 5:22 am

Umm? What do you mean? You create an instance if a class you create that implements `IKeyboardHandler`......

Pretty simple. Also make sure you read the documentation for the `IKeyboardHandler` interface.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Next

Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 16 guests