bind custom keyboard shortcuts via codemirror

+ add reevaluate and panic shortcuts
This commit is contained in:
Felix Roos
2023-11-02 11:24:23 +01:00
parent 0d1a99deb2
commit a89091cbc7
5 changed files with 73 additions and 87 deletions
-10
View File
@@ -1,10 +0,0 @@
import { useLayoutEffect } from 'react';
// set active pattern on ctrl+enter
const useKeydown = (callback) =>
useLayoutEffect(() => {
window.addEventListener('keydown', callback, true);
return () => window.removeEventListener('keydown', callback, true);
}, [callback]);
export default useKeydown;