1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

LibVT: Replace u8 type to u32 for code point

Replace KeyEvent text attribute usage with code_point.
This commit is contained in:
Hüseyin ASLITÜRK 2020-06-13 13:56:39 +03:00 committed by Andreas Kling
parent 53227f400c
commit 7abca30f41
3 changed files with 13 additions and 18 deletions

View file

@ -231,15 +231,7 @@ void TerminalWidget::keydown_event(GUI::KeyEvent& event)
update();
}
if (event.text().length() > 2) {
// Unicode (likely emoji), just emit it.
write(m_ptm_fd, event.text().characters(), event.text().length());
} else {
// Ask the terminal to generate the correct character sequence and send
// it back to us via emit().
u8 character = event.text().length() == 1 ? event.text()[0] : 0;
m_terminal.handle_key_press(event.key(), character, event.modifiers());
}
m_terminal.handle_key_press(event.key(), event.code_point(), event.modifiers());
if (event.key() != Key_Control && event.key() != Key_Alt && event.key() != Key_Shift && event.key() != Key_Logo)
m_scrollbar->set_value(m_scrollbar->max());