forked from DebaucheryLibrarian/traxxx
26 lines
470 B
JavaScript
26 lines
470 B
JavaScript
function initUiObservers(store, _router) {
|
|
document.addEventListener('keypress', (event) => {
|
|
if (event.target.tagName === 'INPUT') {
|
|
return;
|
|
}
|
|
|
|
if (event.key === 's') {
|
|
store.dispatch('setSfw', true);
|
|
}
|
|
|
|
if (event.key === 'n') {
|
|
store.dispatch('setSfw', false);
|
|
}
|
|
|
|
if (event.key === 'd') {
|
|
store.dispatch('setTheme', 'dark');
|
|
}
|
|
|
|
if (event.key === 'l') {
|
|
store.dispatch('setTheme', 'light');
|
|
}
|
|
});
|
|
}
|
|
|
|
export default initUiObservers;
|