CefKeyEvent help

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.

CefKeyEvent help

Postby codelimit » Wed Nov 11, 2020 3:58 pm

Good day dear community.

Can someone help me to clear up some things with CefKeyEvent struct.
I use CEF for Windows OS. Also I use CEF with OSR mode.

I feed CEF with keyboard events, but some of them works incorrect. So I am trying to understand the correct way of doing that.
I didn't find much in the documentation. Also I did search more information here, at forum. It was recommended to follow cefclient/browser/osr_window_win.cc and ceftests/os_rendering_unittest.cc
Those approaches don't suit in my case because I have my custom key codes (i.e. lparam, wparam are lost). But I am able to do some conversions to native scancodes.

So the main question is how to fill CefKeyEvent correctly.
My primary goal is to implement some basic text editing (type chars and symbols, del, some basic hotkeys like ctrl+c, cursor moves and so on).
If I understood correct, at leas I must implement three event types: KEYEVENT_KEYDOWN, KEYEVENT_KEYUP and KEYEVENT_CHAR.
In every case I must fill CefKeyEvent struct and pass it to host.
I see windows_key_code and native_key_code fields in CefKeyEvent struct.
1) Do I need to fill both? Or window's one is enough?
2) If p.1 is YES, do I need to fill native_key_code with fully restored lparam (not only scancode itself, but also contextcode, state, count etc)?

Any help is highly appreciated!
codelimit
Techie
 
Posts: 30
Joined: Mon Nov 04, 2019 11:48 am

Return to Support Forum

Who is online

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