Browse Source

【2025】【综合】快捷键调整

niehaoyu 1 month ago
parent
commit
bc6f029d36

+ 12 - 10
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -5287,6 +5287,7 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
         let command = theEvent.modifierFlags.contains(.command)
         let control = theEvent.modifierFlags.contains(.control)
         let shift = theEvent.modifierFlags.contains(.shift)
+        let option = theEvent.modifierFlags.contains(.option)
         
         KMPrint(theEvent.keyCode)
         if self.listView.isEditing() == true {
@@ -5370,20 +5371,21 @@ extension KMMainViewController: CPDFViewDelegate,CPDFListViewDelegate {
                     self.menuItemEditingClick_CropImage(sender: NSMenuItem())
                 }
             }
-        } else if shift && theEvent.keyCode == 18 {
-            //Shift + 1
+            
+        } else if option && theEvent.keyCode == 18 {
+            //option + 1
             updatePDFViewToolsType(.Select)
-        } else if shift && theEvent.keyCode == 19 {
-            //Shift + 2
+        } else if option && theEvent.keyCode == 19 {
+            //option + 2
             updatePDFViewToolsType(.Scroll)
-        } else if shift && theEvent.keyCode == 20 {
-            //Shift + 3
+        } else if option && theEvent.keyCode == 20 {
+            //option + 3
             updatePDFViewToolsType(.Content_Selection)
-        } else if shift && theEvent.keyCode == 21 {
-            //Shift + 4
+        } else if option && theEvent.keyCode == 21 {
+            //option + 4
             updatePDFViewToolsType(.Magnify)
-        } else if shift && theEvent.keyCode == 23 {
-            //Shift + 5
+        } else if option && theEvent.keyCode == 23 {
+            //option + 5
             updatePDFViewToolsType(.AreaZoom)
         } else if theEvent.keyCode == 53 {
             //ESC

+ 5 - 5
PDF Office/PDF Master/KMClass/KMPDFViewController/Toolbar/Model/KMPDFToolbarManager.swift

@@ -52,11 +52,11 @@ class KMPDFToolbarManager: NSObject {
     
     //MARK: -ToosView
     var toolsProperty: ComponentDropdownToolProperty = ComponentDropdownToolProperty(state: .normal, leftIcon: NSImage(named: "toolbar_Tools_select"), showDropdown: true)
-    var tools_selectProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_select"), keyEquivalent: KMLocalizedString("1"), text: KMLocalizedString("Select"), identifier: KMPDFToolbar_View_Select_Identifier)
-    var tools_scrollProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_scroll"), keyEquivalent: KMLocalizedString("2"), text: KMLocalizedString("Scroll"), identifier: KMPDFToolbar_View_Scroll_Identifier)
-    var tools_contentProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_content"), keyEquivalent: KMLocalizedString("3"), text: KMLocalizedString("Content Selection"), identifier: KMPDFToolbar_View_ContentSelection_Identifier)
-    var tools_magnifyProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_magnify"), keyEquivalent: KMLocalizedString("4"), text: KMLocalizedString("Magnify"), identifier: KMPDFToolbar_View_Magnify_Identifier)
-    var tools_areaProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_zoom"), keyEquivalent: KMLocalizedString("5"), text: KMLocalizedString("Area Zoom"), identifier: KMPDFToolbar_View_AreaZoom_Identifier)
+    var tools_selectProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_select"), keyEquivalent: KMLocalizedString("1"), text: KMLocalizedString("Select"), identifier: KMPDFToolbar_View_Select_Identifier)
+    var tools_scrollProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_scroll"), keyEquivalent: KMLocalizedString("2"), text: KMLocalizedString("Scroll"), identifier: KMPDFToolbar_View_Scroll_Identifier)
+    var tools_contentProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_content"), keyEquivalent: KMLocalizedString("3"), text: KMLocalizedString("Content Selection"), identifier: KMPDFToolbar_View_ContentSelection_Identifier)
+    var tools_magnifyProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_magnify"), keyEquivalent: KMLocalizedString("4"), text: KMLocalizedString("Magnify"), identifier: KMPDFToolbar_View_Magnify_Identifier)
+    var tools_areaProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false, itemSelected: false, isDisabled: false, lefticon: NSImage(named: "toolbar_Tools_zoom"), keyEquivalent: KMLocalizedString("5"), text: KMLocalizedString("Area Zoom"), identifier: KMPDFToolbar_View_AreaZoom_Identifier)
     
     //MARK: -缩放比例
     var selectZoomProperty: ComponentSelectZoomProperty = ComponentSelectZoomProperty(state: .normal, isDisabled: false, text: "100%", leftIcon_nor: NSImage(named: "toolbar_minus"), leftIcon_dis: NSImage(named: "toolbar_minus_dis"), dropdownIcon: NSImage(named: "toolbar_zoom_dropdown"), rightIcon_nor: NSImage(named: "toolbar_plus"), rightIcon_dis: NSImage(named: "toolbar_plus_dis"))