Forwarding text input when using off-screen rendering

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.

Forwarding text input when using off-screen rendering

Postby jtam » Mon Jan 14, 2013 1:51 pm

Hi,

I am writing a mac app that uses CEF1's off-screen rendering. At the moment I am forwarding all keyDown and keyUp events from my application to CEF and this works fine for inputting English characters. However it does not work for Chinese input methods where multiple keystrokes need to be registered before it can be passed onto CEF. I see that browser_webview_mac.mm has implemented this functionality using the interface NSTextInputClient protocol, which include methods like insertText and hasMarkedText. I am thinking to forward the events in the protocol like so:

Application View -> CEF integration code -> call insertText on browser_webview. However I am not sure how to call insertText here, as my view is just an ordinary NSView in this case since I am using off-screen rendering. Is the BrowserWebView class only used when off-screen rendering is not used?

Thanks,
Joe
jtam
Newbie
 
Posts: 3
Joined: Wed Jan 09, 2013 7:49 am

Re: Forwarding text input when using off-screen rendering

Postby magreenblatt » Mon Jan 14, 2013 2:04 pm

Correct, BrowserWebView is not used with off-screen rendering. You need to implement the appropriate protocols in your application. The WebView/WebWidget composition callbacks would then need to be exposed via the CEF API.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Forwarding text input when using off-screen rendering

Postby jtam » Mon Jan 14, 2013 2:11 pm

Could you clarify that code change in CEF is necessary for this to happen?
jtam
Newbie
 
Posts: 3
Joined: Wed Jan 09, 2013 7:49 am

Re: Forwarding text input when using off-screen rendering

Postby magreenblatt » Mon Jan 14, 2013 2:16 pm

browser_webview_mac.mm calls confirmComposition and setComposition and maintains a number of internal state variables. Some portion of this logic would need to live in your application and some portion (at a minimum executing the confirmComposition/setComposition methods) would need to be exposed by CEF.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 187 guests