(shortcut: string)
| 223 | |
| 224 | // 更新快捷键 |
| 225 | public updateShortcut(shortcut: string): { success: boolean; error?: string } { |
| 226 | try { |
| 227 | const success = updateShortcut(shortcut) |
| 228 | if (success) { |
| 229 | return { success: true } |
| 230 | } else { |
| 231 | return { success: false, error: '快捷键已被占用' } |
| 232 | } |
| 233 | } catch (error: unknown) { |
| 234 | console.error('[Settings] 更新快捷键失败:', error) |
| 235 | return { success: false, error: error instanceof Error ? error.message : '未知错误' } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | // 获取当前快捷键 |
| 240 | private getCurrentShortcut(): string { |
no test coverage detected