forked from extern/the-glorious-startpage
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];
|
||
|
}
|
||
|
);
|