Merge pull request #11826 from Snuffleupagus/issue-11657
Change the "download" keyboard shortcut (Ctrl+S) handling, in GENERIC/CHROME builds, to utilize the `EventBus` (issue 11657); add a new "openfile" keyboard shortcut (Ctrl+O), in GENERIC builds
This commit is contained in:
		
						commit
						f243f0564e
					
				
							
								
								
									
										13
									
								
								web/app.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								web/app.js
									
									
									
									
									
								
							| @ -2571,14 +2571,23 @@ function webViewerKeyDown(evt) { | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) { | ||||
|   if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC || CHROME")) { | ||||
|     const { eventBus } = PDFViewerApplication; | ||||
| 
 | ||||
|     // CTRL or META without shift
 | ||||
|     if (cmd === 1 || cmd === 8) { | ||||
|       switch (evt.keyCode) { | ||||
|         case 83: // s
 | ||||
|           PDFViewerApplication.download(); | ||||
|           eventBus.dispatch("download", { source: window }); | ||||
|           handled = true; | ||||
|           break; | ||||
| 
 | ||||
|         case 79: // o
 | ||||
|           if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { | ||||
|             eventBus.dispatch("openfile", { source: window }); | ||||
|             handled = true; | ||||
|           } | ||||
|           break; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user