Why are there 4 different key event types?

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.

Why are there 4 different key event types?

Postby zweieuro » Sat Feb 15, 2025 6:38 am

Hi!
Why are there 4 key event types?
https://github.com/chromiumembedded/cef ... nt_util.cc
On the DOM specs there area only 3 with different names: https://w3c.github.io/uievents/#events- ... vent-order

Which one equates to which? What are they needed for ? My best guess is that CHAR is only needed for keys that actually send a character (so no ctrl/shift) but i am unclear of what rawkeydown and keydown are or what their differences are.
zweieuro
Newbie
 
Posts: 9
Joined: Fri Jan 19, 2024 1:52 pm

Re: Why are there 4 different key event types?

Postby magreenblatt » Sat Feb 15, 2025 11:51 am

Types match Chromium internals. See the CEF sample apps for usage.
magreenblatt
Site Admin
 
Posts: 12968
Joined: Fri May 29, 2009 6:57 pm

Re: Why are there 4 different key event types?

Postby zweieuro » Mon Feb 17, 2025 8:35 am

The sample apps ( I am assuming you mean this: https://github.com/chromiumembedded/cef-project) don't use `sendKeyEvent` at all.

Looking through the test cases in CEF searches for "SendKeyEvent" in the CEF repo, finds E.g. this: https://github.com/chromiumembedded/cef ... t.cc#L1768
which, along with other hits, seems to never send "KEYEVENT_KEYDOWN" at all, just "RAWKEYDOWN".
To me it looks like pressing a key is almost always one of two cases:
system key: RAWKEYDOWN, KEYUP
character key: RAWKEYDOWN, CHAR, KEYUP

The type `KEYEVENT_KEYDOWN` seems to not be used at all in cef other than the source definition, no test lists it.

All 3 delegates win, lin and mac seem to treat them the same anyways ?
mac: https://github.com/chromiumembedded/cef ... ac.mm#L506

win: https://github.com/chromiumembedded/cef ... in.cc#L446

lin: https://github.com/chromiumembedded/cef ... ux.cc#L266



I also can't find a test for a double mouse-click event.
zweieuro
Newbie
 
Posts: 9
Joined: Fri Jan 19, 2024 1:52 pm


Return to Support Forum

Who is online

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