mirror of
https://codeberg.org/uzu/strudel
synced 2026-08-11 00:13:06 -04:00
bind custom keyboard shortcuts via codemirror
+ add reevaluate and panic shortcuts
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user