* optimize room typing members hook * remove unused code - WIP * remove old code from initMatrix * remove twemojify function * remove old sanitize util * delete old markdown util * delete Math atom component * uninstall unused dependencies * remove old notification system * decrypt message in inbox notification center and fix refresh in background * improve notification --------- Co-authored-by: Krishan <33421343+kfiven@users.noreply.github.com>
25 lines
574 B
JavaScript
25 lines
574 B
JavaScript
import { openSearch } from '../action/navigation';
|
|
import navigation from '../state/navigation';
|
|
|
|
function listenKeyboard(event) {
|
|
// Ctrl/Cmd +
|
|
if (event.ctrlKey || event.metaKey) {
|
|
// open search modal
|
|
if (event.key === 'k') {
|
|
event.preventDefault();
|
|
if (navigation.isRawModalVisible) return;
|
|
openSearch();
|
|
}
|
|
}
|
|
}
|
|
|
|
function initHotkeys() {
|
|
document.body.addEventListener('keydown', listenKeyboard);
|
|
}
|
|
|
|
function removeHotkeys() {
|
|
document.body.removeEventListener('keydown', listenKeyboard);
|
|
}
|
|
|
|
export { initHotkeys, removeHotkeys };
|