mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
committed by
Tim Ledbetter
parent
813612096c
commit
6a0c67d5d2
@@ -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.
|
// FIXME: WebContent should really support multi-code point key events.
|
||||||
auto code_point = utf8_view.is_empty() ? 0u : *utf8_view.begin();
|
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) };
|
return { type, key_code, modifiers, code_point, make<KeyData>(event) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user