Browse Source

【文字图片编辑】新增esc案件事件

lizhe 1 year ago
parent
commit
09745c6f26

+ 1 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/WaterMark/KMSubscribeWaterMarkWindowController.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 1 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/WaterMark/View/KMSubscribeWaterMarkView.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 3 - 3
PDF Office/PDF Master/Class/PDFTools/PageEdit/Controller/KMPDFEditViewController.xib

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFEditViewController" customModule="PDF_Office" customModuleProvider="target">
+        <customObject id="-2" userLabel="File's Owner" customClass="KMPDFEditViewController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="contentBox" destination="H78-7z-jdm" id="fst-f6-ba8"/>
                 <outlet property="topBarBox" destination="9MH-c6-Ein" id="4yW-J4-TfZ"/>

+ 3 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/CPDFListEditAnnotationViewController.xib

@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditImagePropertyViewController.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 22 - 0
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -334,6 +334,28 @@ import Cocoa
         self.autoSaveTimeStartOrStopIfNeed()
         
         self.toolbarController.selectItem(KMDocumentAnnotationToolbarItemIdentifier)
+        
+        NSEvent.addLocalMonitorForEvents(matching: .keyDown) { [unowned self] event in
+            print(event.keyCode)
+            if event.keyCode == 53 {
+                if self.listView.toolMode == .editPDFToolMode {
+                    if self.listView.annotationType == .addImage ||
+                        self.listView.annotationType == .addText {
+                        let textItem = self.toolbarController.findItem(KMToolbarAddTextEditPDFItemIdentifier)
+                        let imageItem = self.toolbarController.findItem(KMToolbarAddImageEditPDFItemIdentifier)
+                        textItem?.isSelected = false
+                        imageItem?.isSelected = false
+                    }
+                    
+                    self.rightSideViewController.isHidden = true
+                    self.listView.setShouAddEdit([])
+                    self.listView.change([.text, .image])
+                    self.listView.annotationType = .editTextImage
+                    self.closeRightPane()
+                }
+            }
+            return event
+        }
     }
         
     //MARK: - PDFListView