ladybird/Tests/LibWeb/Text/input/UIEvents/KeyEvent-functional-keys.html
2025-03-20 11:50:49 +01:00

33 lines
714 B
HTML

<!DOCTYPE html>
<input id="input" />
<script src="../include.js"></script>
<script>
const FUNCTIONAL_KEYS = [
"CapsLock",
"Escape",
"Return",
"Space",
"Tab",
"LeftAlt",
"RightAlt",
"LeftControl",
"RightControl",
"LeftShift",
"RightShift",
"LeftSuper",
"RightSuper",
];
test(() => {
let input = document.getElementById("input");
input.addEventListener("keydown", e => {
println(`key=${e.key} code=${e.code}`);
e.preventDefault();
});
FUNCTIONAL_KEYS.forEach(key => {
internals.sendKey(input, key);
});
});
</script>