@@ -354,19 +354,49 @@ function initialize() {
354354 } ) ;
355355
356356 // Register shortcut to take screenshot based on current mode
357- globalShortcut . register ( 'CommandOrControl+P' , ( ) => {
357+ const registered = globalShortcut . register ( 'CommandOrControl+P' , ( ) => {
358+ console . log ( 'Shortcut triggered, area select mode:' , isAreaSelectMode ) ;
359+
358360 // Hide the preview window if it's open
359361 if ( mainWindow && ! mainWindow . isDestroyed ( ) ) {
360362 mainWindow . hide ( ) ;
361363 }
362364
363365 // Take new screenshot based on mode
364366 if ( isAreaSelectMode ) {
367+ console . log ( 'Starting area screenshot...' ) ;
365368 takeAreaScreenshot ( ) ;
366369 } else {
370+ console . log ( 'Taking full screenshot...' ) ;
367371 takeScreenshot ( ) ;
368372 }
369373 } ) ;
374+
375+ if ( ! registered ) {
376+ console . error ( 'Failed to register shortcut CommandOrControl+P' ) ;
377+ } else {
378+ console . log ( 'Shortcut CommandOrControl+P registered successfully' ) ;
379+ }
380+
381+ // Register an alternative shortcut for Windows
382+ if ( process . platform === 'win32' ) {
383+ const altRegistered = globalShortcut . register ( 'Alt+P' , ( ) => {
384+ console . log ( 'Alt+P triggered, area select mode:' , isAreaSelectMode ) ;
385+ if ( isAreaSelectMode ) {
386+ console . log ( 'Starting area screenshot...' ) ;
387+ takeAreaScreenshot ( ) ;
388+ } else {
389+ console . log ( 'Taking full screenshot...' ) ;
390+ takeScreenshot ( ) ;
391+ }
392+ } ) ;
393+
394+ if ( ! altRegistered ) {
395+ console . error ( 'Failed to register shortcut Alt+P' ) ;
396+ } else {
397+ console . log ( 'Alternative shortcut Alt+P registered successfully for Windows' ) ;
398+ }
399+ }
370400}
371401
372402// Wait for app to be ready
0 commit comments