1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 15:45:07 +00:00

LibGUI: Replace text attribute on KeyEvent with code_point attribute

This commit is contained in:
Hüseyin ASLITÜRK 2020-06-11 21:31:53 +03:00 committed by Andreas Kling
parent 0aad21fff2
commit 53227f400c
3 changed files with 25 additions and 18 deletions

View file

@ -889,8 +889,11 @@ void TextEditor::keydown_event(KeyEvent& event)
return;
}
if (!is_readonly() && !event.ctrl() && !event.alt() && !event.text().is_empty()) {
insert_at_cursor_or_replace_selection(event.text());
if (!is_readonly() && !event.ctrl() && !event.alt() && event.code_point() != 0) {
StringBuilder sb;
sb.append_codepoint(event.code_point());
insert_at_cursor_or_replace_selection(sb.to_string());
return;
}