mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
Terminal: Turn ctrl+character into the appropriate ^character.
This commit is contained in:
parent
aa24547e12
commit
ff4d6afb60
Notes:
sideshowbarker
2024-07-19 15:57:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ff4d6afb603
1 changed files with 9 additions and 1 deletions
|
@ -115,7 +115,15 @@ int main(int, char**)
|
|||
if (event.type == GUI_Event::Type::Paint) {
|
||||
terminal.paint();
|
||||
} else if (event.type == GUI_Event::Type::KeyDown) {
|
||||
write(ptm_fd, &event.key.character, 1);
|
||||
char ch = event.key.character;
|
||||
if (event.key.ctrl) {
|
||||
if (ch >= 'a' && ch <= 'z') {
|
||||
ch = ch - 'a' + 1;
|
||||
} else if (ch == '\\') {
|
||||
ch = 0x1c;
|
||||
}
|
||||
}
|
||||
write(ptm_fd, &ch, 1);
|
||||
} else if (event.type == GUI_Event::Type::WindowActivated) {
|
||||
terminal.set_in_active_window(true);
|
||||
} else if (event.type == GUI_Event::Type::WindowDeactivated) {
|
||||
|
|
Loading…
Add table
Reference in a new issue