mirror of
https://github.com/danbulant/presentations
synced 2026-05-19 04:18:36 +00:00
add controls for presenter
This commit is contained in:
parent
8addbcc8b2
commit
6544cd40ea
1 changed files with 22 additions and 0 deletions
|
|
@ -9,3 +9,25 @@ import script from './scenes/script?scene';
|
|||
export default makeProject({
|
||||
scenes: [intro, program, code, printf, script],
|
||||
});
|
||||
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.key === "PageDown") {
|
||||
// send fake space key
|
||||
const event = new KeyboardEvent("keydown", {
|
||||
key: " ",
|
||||
code: "Space",
|
||||
keyCode: 32,
|
||||
which: 32
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
} else if (e.key === "PageUp") {
|
||||
// send fake arrow left key
|
||||
const event = new KeyboardEvent("keydown", {
|
||||
key: "ArrowLeft",
|
||||
code: "ArrowLeft",
|
||||
keyCode: 37,
|
||||
which: 37
|
||||
});
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
})
|
||||
Loading…
Reference in a new issue