BackSpace,Tab Keys are not working in OffScreenRendering

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.

BackSpace,Tab Keys are not working in OffScreenRendering

Postby nambi » Mon Jun 23, 2014 7:11 am

Hi,

I am doing OffScreenRendering and display the pixel buffer using QT framework.
Whenever i typed in browser window, Keyevents are delivered from QT.
I have a Test App for sending the events to CEF. My TestApp file uses SendKeyEvent() API to send the events to CEF.

Alpha-numeric keys are working fine with the above procedure. But Navigational keys (Backspace,tab, Left,Right,etc..) are not working.
I am setting the keyevents as below,

void window::keyReleaseEvent(QKeyEvent event){
CefKeyEvent key_event;
key_event.character=0;
key_event.unmodified_character = 0;
key_event.native_key_code = evt->key();
key_event.modifiers = 0;
key_event.type = KEYEVENT_KEYUP;
Browser->SendKeyEvent(key_event);
}
Is there any specific settings required for handling the above keys. Please help me how to make it work..
nambi
Newbie
 
Posts: 2
Joined: Mon Jun 23, 2014 6:34 am

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby magreenblatt » Mon Jun 23, 2014 10:14 am

I don't know what you need to do with QKeyEvent specifically but you can see examples from other frameworks in the cefclient sample application or here: https://code.google.com/p/javachromiume ... wser_N.cpp
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Sun Aug 17, 2014 11:12 pm

Hi, thanks for the link.

Nambi did this solve your issue? I'm having a similar problem with Keys being passed to offscreen rendering. ( CEF3 1650.1562 on Windows)

In my case it's similar to this thread. In this thread the poster maps created key mappings and translated between them. I've done that and it works up to a point. eg I use it to correctly select uppercase and lowercase based on whether the shift key is down. Numeric keys work fine, but when I try to convert symbols above the numeric keys (!@#$% etc) only some of them work. Specifically !@^*) .

The reason why I'm posting here is the example code does a lot of mapping for Linux and particularly Mac, but the IFDEF'd windows code seems to have hardly any of that manual mapping. I must be missing something.

Anyone have any thoughts on what's going on here? My first thought was Culture info or Unicode or something but that's character related rather than key related so maybe not.

For interest, the project I'm working on is MyVirtualHome. I'm currently replacing Berkelium with CEF and it's going well.

Many thanks.
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Wed Aug 27, 2014 6:38 pm

Hi again,

Just bumping this because I'm still having issues.

AndrewH wrote:In my case it's similar to this thread. In this thread the poster maps created key mappings and translated between them. I've done that and it works up to a point. eg I use it to correctly select uppercase and lowercase based on whether the shift key is down. Numeric keys work fine, but when I try to convert symbols above the numeric keys (!@#$% etc) only some of them work. Specifically !@^*) .


Does anyone have any thoughts on what be causing this?

Regards
Andrew
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Wed Aug 27, 2014 7:40 pm

For example, when I press , . and / keys, I instead get ¼¾ and ¿ respectively.

I'm setting the Windows key code but I don't really get how it relates to virtual key codes versus ascii characters.

Code: Select all
  ///
  // The Windows key code for the key event. This value is used by the DOM
  // specification. Sometimes it comes directly from the event (i.e. on
  // Windows) and sometimes it's determined using a mapping function. See
  // WebCore/platform/chromium/KeyboardCodes.h for the list of values.
  ///
  int windows_key_code;


On checking out the suggested header WebCore/platform/chromium/KeyboardCodes.h it seems to just deal with virtual keys.

for VK_OEM_PERIOD for example, If I try changing from the virtual key (0xBE / 190) to the ascii code of the period (46) it doesn't work. However changing it to (62) when the shift key is pressed correctly returns the ">" key. It also works for the ! and @ keys but not the # key. Getting the ¼¾ and ¿ keys kind of makes sense because those are the ascii characters that match the virtual keys that I sent, but I am having trouble reconciling that with the code comments.

Many thanks for any assistance.

Regards,
Andrew
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Wed Aug 27, 2014 8:25 pm

I see where events are translated from cef to webkit and suspect the answer is in here somewhere but I don't see it :{ . libcef/browser/browser_host_impl_win.cc
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Tue Sep 02, 2014 2:25 am

bump :)
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm

Re: BackSpace,Tab Keys are not working in OffScreenRenderin

Postby AndrewH » Tue Sep 09, 2014 8:59 pm

Resolved here.

TLDR: don't ignore WM_CHAR and try to create the CHAR cef:Keyboard event using only the keyup or keydown. There's sample code floating around that does this and it's wrong.
AndrewH
Techie
 
Posts: 10
Joined: Sun Aug 17, 2014 10:33 pm


Return to Support Forum

Who is online

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