Added Home, End, PageUp, PageDown events.

Added handling for Home and End for input component
This commit is contained in:
d
2021-03-28 02:01:04 +02:00
committed by Arthur Sonzogni
parent a6c692edcf
commit 160b1c8bbc
3 changed files with 22 additions and 0 deletions

View File

@@ -85,6 +85,16 @@ bool Input::OnEvent(Event event) {
return true;
}
if (event == Event::Home) {
cursor_position = 0;
return true;
}
if (event == Event::End) {
cursor_position = (int)content.size();
return true;
}
// Content
if (event.is_character()) {
content.insert(cursor_position, 1, event.character());