I am using CEF version 3.2556.1368 and extended the cefclient sample in off-screen-rendering mode in a way that offscreen rendering window receives the keyoard input through my interface instead from the existing main root window through its window procedure.
I am using SendKeyEvent to send the keyboard inputs to the bowser.
Here is the small code snippet
DoKeyEvent(unsigned long vkCode, bool isDown, bool extended){
CefKeyEvent event;
event.windows_key_code = vkCode;
event.native_key_code = MapVirtualKey(vkCode,MAPVK_VK_TO_VSC);
event.is_system_key = 0;
if(isDown)
{
event.type = KEYEVENT_RAWKEYDOWN;
}
else
{
event.type = KEYEVENT_KEYUP;
}
event.modifiers = GetCefKeyboardModifiers(vkCode,isDown,extended);
browser_->GetHost()->SendKeyEvent(event);
}
Can anyone tell what is wrong with this code as i am not able to generate the desire result.
For eg VK_Code for generating "a" is ( 65 (Dec) or 0x41 (Hex) ) , even if i hardcode this value , i am not able to simulate "a" through the bowser.
Even if no modifiers is being used then also the result is not appropriate.
Just want to simulate simple "a" character without using any modifiers.
What i am doing wrong ??