When Focus is set to CEF browser, Keyboard Event is lost

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.

When Focus is set to CEF browser, Keyboard Event is lost

Postby shanmuganathan » Fri Sep 08, 2017 4:34 am

When the browser control has the focus, any keys being pressed seem to be eaten by the browser control, why ?

Certain support post recommends to switch off "multi_threaded_message_loop" , but i cannot do that.

Let me know how to handle browser events with a example.

I am using latest CEF binary file "cef_binary_3.3112.1659" in Visual Studio 2013 environment.
(http://opensource.spotify.com/cefbuilds/index.html)

sample.png
sample.png (44.01 KiB) Viewed 11793 times
shanmuganathan
Newbie
 
Posts: 4
Joined: Fri Sep 08, 2017 1:09 am

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby magreenblatt » Fri Sep 08, 2017 10:33 am

What OS? Does the problem reproduce with cefclient when running with the "--multi-threaded-message-loop" command-line flag?
magreenblatt
Site Admin
 
Posts: 12406
Joined: Fri May 29, 2009 6:57 pm

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby skocef » Mon Sep 11, 2017 3:20 am

I had exactly same problem in my Windows app. Also with multi_threaded_message_loop=true. I ended up catching keyboard events with OnPreKeyEvent and forwarding them to main frame. But I needed only F-keys.
skocef
Newbie
 
Posts: 6
Joined: Fri Sep 08, 2017 4:36 am

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby skocef » Mon Sep 11, 2017 5:15 am

shanmuganathan, could you take a look on thishttp://www.magpcss.org/ceforum/viewtopic.php?f=6&t=15424.
Have you tried to open/close browser windows in your application quickly? Looks like the problem happens only with multi_threaded_message_loop set to ON.
skocef
Newbie
 
Posts: 6
Joined: Fri Sep 08, 2017 4:36 am

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby cretz » Mon Sep 11, 2017 11:12 am

Just to add my experience here, I too capture the events and forward 'em myself. See here for Linux and here for Windows.
cretz
Techie
 
Posts: 34
Joined: Mon Jun 26, 2017 11:41 am

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby shanmuganathan » Fri Sep 15, 2017 4:59 am

magreenblatt wrote:What OS? Does the problem reproduce with cefclient when running with the "--multi-threaded-message-loop" command-line flag?

I tried in Windows 7 & Windows 10, yes it replicates even in CEf Client.
shanmuganathan
Newbie
 
Posts: 4
Joined: Fri Sep 08, 2017 1:09 am

Re: When Focus is set to CEF browser, Keyboard Event is lost

Postby shanmuganathan » Fri Sep 15, 2017 5:01 am

skocef wrote:I had exactly same problem in my Windows app. Also with multi_threaded_message_loop=true. I ended up catching keyboard events with OnPreKeyEvent and forwarding them to main frame. But I needed only F-keys.

Thanks for the reply. I tried "OnPreKeyEvent" and didn't receive any messages even in that function.
It would be great if you could share a sample, so i can cross check if anything i have missed in my implementation.
shanmuganathan
Newbie
 
Posts: 4
Joined: Fri Sep 08, 2017 1:09 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 38 guests