Files
ladybird/Tests/LibWeb/Text/input/UIEvents/KeyEvent-ctrl-c.html
Timothy Flynn d852b59d99 LibWeb: Handle unidentified, non-modifier key events
This allows terminal control sequences to work in the web version of
the ghostty terminal. For a ctrl+c sequence, we would previously send:

    key=Unidentified code=KeyC

We now send:

    key=c code=KeyC
2025-12-08 12:01:13 -05:00

15 lines
428 B
HTML

<!DOCTYPE html>
<input id="input" />
<script src="../include.js"></script>
<script>
test(() => {
input.addEventListener("keydown", e => {
println(`key="${e.key}" code=${e.code} ctrlKey=${e.ctrlKey}`);
e.preventDefault();
});
internals.sendKey(input, "C", internals.MOD_CTRL);
internals.sendKey(input, "C", internals.MOD_CTRL | internals.MOD_SHIFT);
});
</script>