UNPKG

twokeys-server

Version:

Server for 2Keys

105 lines (95 loc) 4.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** Copyright 2018 Kishan Sambhi This file is part of 2Keys. 2Keys is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 2Keys is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with 2Keys. If not, see <https://www.gnu.org/licenses/>. */ const path_1 = require("path"); const os_1 = require("os"); /** * @overview Constants for 2Keys */ exports.DEBUG = "debug"; exports.DEFAULT_PORT = 9090; exports.CONFIG_FILE = "config.yml"; //export const AHK_LIB_PATH: string = "D:\\Users\\Kishan\\Documents\\Projects\\2Keys\\cli\\lib\\ahkdll-v1-release-master\\x64w\\AutoHotkey.dll"; exports.AHK_LIB_PATH = "D:\\Users\\Kishan\\Documents\\Projects\\2Keys\\cli\\lib\\ahkdll-v2-release-master\\x64w\\AutoHotkey.dll"; exports.AHK_DOWNLOAD_PATH = "https://codeload.github.com/HotKeyIt/ahkdll-v2-release/zip/master"; exports.AHK_VERSION = "2.0.0-alpha"; // Default paths exports.DEFAULT_USERSPACE_ROOT = path_1.join(os_1.homedir(), ".2Keys"); exports.DEFAULT_USERSPACE_CONFIG = path_1.join(os_1.homedir(), ".2Keys.rc.yml"); exports.DEFAULT_USERSPACE_SOFTWARE_ROOT = path_1.join(exports.DEFAULT_USERSPACE_ROOT, "software"); exports.DEFAULT_USERSPACE_SOFTWARE_DOWNLOAD = path_1.join(exports.DEFAULT_USERSPACE_SOFTWARE_ROOT, ".tmp"); // Where to download files to exports.DEFAULT_USERSPACE_SOFTWARE_PATHS = { ahk: { root: path_1.join(exports.DEFAULT_USERSPACE_SOFTWARE_ROOT, "ahk"), dll: "./x64w/AutoHotkey.dll", exe: "./x64w/AutoHotkey.exe" } }; exports.default_userspace_config = { oobe: false, paths: { root: exports.DEFAULT_USERSPACE_ROOT, software: exports.DEFAULT_USERSPACE_SOFTWARE_ROOT, }, software: { ahk: { version: "2.0.0-alpha", paths: { root: "./ahk", dll: "./x64w/AutoHotkey.dll", exe: "./x64w/AutoHotkey.exe", }, }, }, }; exports.DEFAULT_HOTKEY_FILE_ROOT = "index.ahk"; // Default root AHK file exports.DEFAULT_AHK_ROOT_CONTENTS = `; File generated by 2Keys ; 2Keys AutoHotkey entry point ; Default AHK stuff ;#SingleInstance, force ; Uncomment this line if using AutoHotkey < v2 SetWorkingDir A_ScriptDir ; Ensures a consistent starting directory. ;#Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. ; CONVERSION NOTICE 1 ; All your hotkeys need to changed to functions ; Then, include the function to run in your config under the key mapping. ; The script with the function in should then be included below. ; See https://github.com/Gum-Joe/2Keys for help ; CONVERSION NOTICE 2 ; Since the keyboards are plugged into a separte computer (the detector) ; You can't get keyboard states (and info. about the keyboards) using AutoHotkeys ; Soon we'll be adding a set of core libraries which will allow you to do, i.e.: ; #Include <2Keys/keyboards> ; keyboards.getState(keyboard, key) ; Syntax is subject to change ; CONVERSION NOTICE 3 ; Depending on the version of AutoHotkey 2Keys is using ; You may need to migrate your scripts to AutoHotkey v2 ; Include all your AutoHotkey scripts here ; i.e. #Include "run-apps.ahk" `; // Default Service prefix exports.WINDOWS_DAEMON_PREFIX = "2Keys-"; exports.WINDOWS_DAEMON_FILE = "daemon.js"; exports.WINDOWS_DAEMON_FILE_VBS = "daemon.vbs"; exports.WINDOWS_DAEMON_FILE_JS_TEMPLATE = path_1.join(__dirname, `../../assets/${exports.WINDOWS_DAEMON_FILE}`); exports.WINDOWS_DAEMON_FILE_VBS_TEMPLATE = path_1.join(__dirname, `../../assets/${exports.WINDOWS_DAEMON_FILE_VBS}`); exports.WINDOWS_DAEMON_PID_FILE = "daemon.pid"; exports.WINDOWS_SERVER_PID_FILE = "server.pid"; // Local project stuff exports.DEFAULT_LOCAL_2KEYS = ".2Keys"; // Where local 2Keys files are, i.e. windows service files //# sourceMappingURL=constants.js.map