Trigger keyDown and keyUp for special keys

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.

Re: Trigger keyDown and keyUp for special keys

Postby magreenblatt » Fri Apr 11, 2014 9:58 am

magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Trigger keyDown and keyUp for special keys

Postby zfjon » Tue Mar 08, 2016 2:26 pm

I'm adding a note here for future posterity:

I also had issues with CEF incorrectly repeating down keystrokes in offscreen mode on a Mac. Specifically, CEF was sending a keydown event when I sent a KEYEVENT_KEYUP. Setting keyEvent.character or keyEvent.unmodified_character for the down and up events, in addition to the KEYEVENT_CHAR events fixes it.

Look like we're probably getting bit by this piece of code here (browser_platform_delegate_native_mac.mm):
Code: Select all
  if (key_event.character == 0 && key_event.unmodified_character == 0) {
    ...
    event_type = NSFlagsChanged;
  } else {
    switch (key_event.type) {
      case KEYEVENT_RAWKEYDOWN:
      case KEYEVENT_KEYDOWN:
      case KEYEVENT_CHAR:
        event_type = NSKeyDown;
        break;
      case KEYEVENT_KEYUP:
        event_type = NSKeyUp;
        break;
    }
  }
zfjon
Newbie
 
Posts: 2
Joined: Tue Mar 08, 2016 2:14 pm

Previous

Return to Support Forum

Who is online

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