+
IDE (Priority: 50)
+
Press ESC to close (or blur Monaco if focused)
+
setMonacoHasFocus(true)}
+ onBlur={() => setMonacoHasFocus(false)}
+ />
+ {monacoHasFocus && (
+
Monaco focused - ESC will blur and pass to next handler
+ )}
+
+ );
+}
+
+function PanelExample() {
+ const [isOpen, setIsOpen] = useState(true);
+
+ useKeyboardShortcut(
+ 'Escape',
+ () => {
+ console.log('Panel: Closing panel');
+ setIsOpen(false);
+ },
+ PRIORITY.PANEL
+ );
+
+ if (!isOpen)
+ return