File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,6 +713,23 @@ describe("PreviewManager", () => {
713713 ) ;
714714 expect ( preventDefault ) . toHaveBeenCalledOnce ( ) ;
715715 expect ( send ) . toHaveBeenCalledTimes ( 2 ) ;
716+
717+ Object . assign ( preview . webContents , { focusedFrame : mainFrame } ) ;
718+ yield * manager . setForwardedShortcuts ( [
719+ { command : "preview.find" , shortcut : parseKeybindingShortcut ( "ctrl+alt+8" ) ! } ,
720+ ] ) ;
721+ pageUnhandledShortcut (
722+ { } ,
723+ {
724+ key : "[" ,
725+ code : "Digit8" ,
726+ metaKey : false ,
727+ ctrlKey : true ,
728+ shiftKey : false ,
729+ altKey : true ,
730+ } ,
731+ ) ;
732+ expect ( send ) . toHaveBeenCalledTimes ( usesMeta ? 3 : 2 ) ;
716733 } ) ,
717734 platform ,
718735 ) ,
Original file line number Diff line number Diff line change @@ -1468,6 +1468,12 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
14681468 } ) ;
14691469 } ;
14701470 const findForwardedShortcut = ( keys : Parameters < typeof matchesKeybindingShortcut > [ 0 ] ) =>
1471+ ! (
1472+ hostPlatform !== "darwin" &&
1473+ keys . ctrlKey &&
1474+ keys . altKey &&
1475+ / ^ (?: [ ^ a - z A - Z 0 - 9 ] | D e a d ) $ / u. test ( keys . key )
1476+ ) &&
14711477 forwardedShortcuts . find ( ( { shortcut } ) =>
14721478 matchesKeybindingShortcut (
14731479 keys ,
@@ -1494,12 +1500,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
14941500 host &&
14951501 ! host . isDestroyed ( ) &&
14961502 holdsKeyboardFocus ( wc ) &&
1497- ! (
1498- hostPlatform !== "darwin" &&
1499- input . control &&
1500- input . alt &&
1501- / ^ (?: [ ^ a - z A - Z 0 - 9 ] | D e a d ) $ / u. test ( input . key )
1502- ) &&
15031503 findForwardedShortcut ( {
15041504 key : input . key ,
15051505 code : input . code ,
You can’t perform that action at this time.
0 commit comments