UI/AppKit: Do not expose PUA key event code points to WebContent
AppKit uses Private Use Area code points for a large collection of functional keys (arrows, home/end, etc.). Re-assign them to 0 to avoid tripping up WebContent's key handler.
This commit is contained in:
parent
813612096c
commit
6a0c67d5d2
Notes:
github-actions[bot]
2024-09-05 13:39:13 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/6a0c67d5d22 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1284 Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 0 deletions
|
@ -304,6 +304,10 @@ Web::KeyEvent ns_event_to_key_event(Web::KeyEvent::Type type, NSEvent* event)
|
|||
// FIXME: WebContent should really support multi-code point key events.
|
||||
auto code_point = utf8_view.is_empty() ? 0u : *utf8_view.begin();
|
||||
|
||||
// NSEvent assigns PUA code points to to functional keys, e.g. arrow keys. Do not propagate them.
|
||||
if (code_point >= 0xE000 && code_point <= 0xF8FF)
|
||||
code_point = 0;
|
||||
|
||||
return { type, key_code, modifiers, code_point, make<KeyData>(event) };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue