summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/TextEditor.cpp
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-06-11 21:31:53 +0300
committerAndreas Kling <kling@serenityos.org>2020-06-16 13:15:17 +0200
commit53227f400cfff6d9d295903eaf6de8d51bce6868 (patch)
tree1dea447dbaee0ee6deb3051bcf4d628b230a90fc /Libraries/LibGUI/TextEditor.cpp
parent0aad21fff2e1335d433de726d269e2693769cd69 (diff)
downloadserenity-53227f400cfff6d9d295903eaf6de8d51bce6868.zip
LibGUI: Replace text attribute on KeyEvent with code_point attribute
Diffstat (limited to 'Libraries/LibGUI/TextEditor.cpp')
-rw-r--r--Libraries/LibGUI/TextEditor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp
index 1257a942d3..b2a8930ce1 100644
--- a/Libraries/LibGUI/TextEditor.cpp
+++ b/Libraries/LibGUI/TextEditor.cpp
@@ -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;
}