darwin keewebhelper draft

This commit is contained in:
antelle 2016-07-23 10:48:56 +03:00
parent c4a9c867f1
commit 81394c8c59
3 changed files with 269 additions and 0 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@ keys/
*.user
bin/
obj/
*.xcworkspace/
xcuserdata/

View File

@ -0,0 +1,248 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
48395FC01D434F0000BF9A6E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48395FBF1D434F0000BF9A6E /* main.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
48395FBA1D434F0000BF9A6E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
48395FBC1D434F0000BF9A6E /* KeeWebHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = KeeWebHelper; sourceTree = BUILT_PRODUCTS_DIR; };
48395FBF1D434F0000BF9A6E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
48395FB91D434F0000BF9A6E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
48395FB31D434F0000BF9A6E = {
isa = PBXGroup;
children = (
48395FBE1D434F0000BF9A6E /* KeeWebHelper */,
48395FBD1D434F0000BF9A6E /* Products */,
);
sourceTree = "<group>";
};
48395FBD1D434F0000BF9A6E /* Products */ = {
isa = PBXGroup;
children = (
48395FBC1D434F0000BF9A6E /* KeeWebHelper */,
);
name = Products;
sourceTree = "<group>";
};
48395FBE1D434F0000BF9A6E /* KeeWebHelper */ = {
isa = PBXGroup;
children = (
48395FBF1D434F0000BF9A6E /* main.swift */,
);
path = KeeWebHelper;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
48395FBB1D434F0000BF9A6E /* KeeWebHelper */ = {
isa = PBXNativeTarget;
buildConfigurationList = 48395FC31D434F0000BF9A6E /* Build configuration list for PBXNativeTarget "KeeWebHelper" */;
buildPhases = (
48395FB81D434F0000BF9A6E /* Sources */,
48395FB91D434F0000BF9A6E /* Frameworks */,
48395FBA1D434F0000BF9A6E /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = KeeWebHelper;
productName = KeeWebHelper;
productReference = 48395FBC1D434F0000BF9A6E /* KeeWebHelper */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
48395FB41D434F0000BF9A6E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = KeeWeb;
TargetAttributes = {
48395FBB1D434F0000BF9A6E = {
CreatedOnToolsVersion = 7.3.1;
};
};
};
buildConfigurationList = 48395FB71D434F0000BF9A6E /* Build configuration list for PBXProject "KeeWebHelper" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 48395FB31D434F0000BF9A6E;
productRefGroup = 48395FBD1D434F0000BF9A6E /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
48395FBB1D434F0000BF9A6E /* KeeWebHelper */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
48395FB81D434F0000BF9A6E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
48395FC01D434F0000BF9A6E /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
48395FC11D434F0000BF9A6E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
48395FC21D434F0000BF9A6E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
48395FC41D434F0000BF9A6E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
48395FC51D434F0000BF9A6E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
48395FB71D434F0000BF9A6E /* Build configuration list for PBXProject "KeeWebHelper" */ = {
isa = XCConfigurationList;
buildConfigurations = (
48395FC11D434F0000BF9A6E /* Debug */,
48395FC21D434F0000BF9A6E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
48395FC31D434F0000BF9A6E /* Build configuration list for PBXNativeTarget "KeeWebHelper" */ = {
isa = XCConfigurationList;
buildConfigurations = (
48395FC41D434F0000BF9A6E /* Debug */,
48395FC51D434F0000BF9A6E /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 48395FB41D434F0000BF9A6E /* Project object */;
}

View File

@ -0,0 +1,19 @@
import Foundation
let src = CGEventSourceCreate(CGEventSourceStateID.HIDSystemState)
func pressChar(char: UniChar) {
pressCharUpDown(char, down: true)
pressCharUpDown(char, down: false)
}
func pressCharUpDown(char: UniChar, down: Bool) {
var ch = char;
let keyEvent = CGEventCreateKeyboardEvent(src, 0, down)
CGEventKeyboardSetUnicodeString(keyEvent, 1, &ch)
CGEventPost(CGEventTapLocation.CGHIDEventTap, keyEvent)
}
for char in "\n^A~A´A¼Î©~{*!+¢f4ыâ\n".utf16 {
pressChar(char)
}