-
Notifications
You must be signed in to change notification settings - Fork 34
Add custom keyboard shortcuts configuration #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,9 +111,17 @@ contextBridge.exposeInMainWorld('claude', { | |
| ipcRenderer.on('toggle-search-modal', () => callback()); | ||
| }, | ||
|
|
||
| // Global keyboard shortcuts | ||
| onNewConversation: (callback: () => void) => { | ||
| ipcRenderer.on('new-conversation', () => callback()); | ||
| }, | ||
| onToggleSidebar: (callback: () => void) => { | ||
| ipcRenderer.on('toggle-sidebar', () => callback()); | ||
| }, | ||
|
|
||
| // Settings functions | ||
| openSettings: () => ipcRenderer.invoke('open-settings'), | ||
| getSettings: () => ipcRenderer.invoke('get-settings'), | ||
| saveSettings: (settings: { spotlightKeybind?: string; spotlightPersistHistory?: boolean }) => | ||
| saveSettings: (settings: { spotlightKeybind?: string; spotlightPersistHistory?: boolean; keyboardShortcuts?: { spotlight?: string; newConversation?: string; toggleSidebar?: string } }) => | ||
| ipcRenderer.invoke('save-settings', settings), | ||
|
Comment on lines
+125
to
126
|
||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the default spotlight shortcut registration also fails (which could happen if another application is using it), the application will throw an unhandled error. Consider wrapping this fallback in a try-catch as well: