The problem was that I wasn't making use of the WM_CHAR message, only the Keyup and Keydown messages.
I think it stemmed from the example code I was using. I don't even really recall where this came from, except that I found it when first looking at offscreen. I'll list it here in case anyone else is using it.
This really isn't correct.
- Code: Select all
if (keyPressed)
{
event.windows_key_code = vkey;
event.type = KEYEVENT_RAWKEYDOWN;
cef_browser->GetHost()->SendKeyEvent(event);
event.type = KEYEVENT_CHAR;
cef_browser->GetHost()->SendKeyEvent(event);
}
else
{
event.windows_key_code = vkey;
// bits 30 and 31 should be always 1 for WM_KEYUP
event.native_key_code |= 0xC0000000;
event.type = KEYEVENT_KEYUP;
cef_browser->GetHost()->SendKeyEvent(event);
}
The KEYEVENT_CHAR needs to be sent from the WM_CHAR message, as in the cefclient example. The above is absolutely incorrect. You can't construct it properly based only on WM_KEYDOWN event. At least I couldn't.
I'm guessing that this probably seems obvious to those who know. But I got waylaid by this sample code which (unfortunately) kind of worked enough that I didn't question it.
Thanks again for your response.
Regards
Andrew