mirror of
https://github.com/manilarome/the-glorious-startpage.git
synced 2024-11-28 10:33:08 +01:00
31 lines
644 B
JavaScript
31 lines
644 B
JavaScript
let keysPressed = {};
|
|
|
|
|
|
|
|
document.addEventListener(
|
|
'keydown',
|
|
(event) => {
|
|
event.preventDefault();
|
|
|
|
keysPressed[event.key] = true;
|
|
|
|
// Open dashboard
|
|
if (keysPressed['Alt'] && event.key === 's') {
|
|
toggleDashboard();
|
|
return;
|
|
} else if (keysPressed['Alt'] && event.key === 'e') {
|
|
toggleWebMenu();
|
|
return;
|
|
} else if (keysPressed['Alt'] && event.key === 'x') {
|
|
toggleWeatherScreen();
|
|
return;
|
|
}
|
|
}
|
|
);
|
|
|
|
document.addEventListener(
|
|
'keyup',
|
|
(event) => {
|
|
delete keysPressed[event.key];
|
|
}
|
|
); |