mirror of
https://github.com/AkiChase/scrcpy-mask
synced 2025-04-21 04:25:13 +08:00
refactor(tools): move to tools folder
This commit is contained in:
parent
4cb9897f11
commit
ee5862412b
@ -18,7 +18,7 @@ import {
|
||||
getDeviceScreenSize,
|
||||
adbConnect,
|
||||
getCurClientInfo,
|
||||
} from "../invoke";
|
||||
} from "../tools/invoke";
|
||||
import {
|
||||
NH4,
|
||||
NInput,
|
||||
@ -40,7 +40,10 @@ import { UnlistenFn, listen } from "@tauri-apps/api/event";
|
||||
import { shutdown } from "../frontcommand/scrcpyMaskCmd";
|
||||
import { useGlobalStore } from "../store/global";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { closeExternalControl, connectExternalControl } from "../websocket";
|
||||
import {
|
||||
closeExternalControl,
|
||||
connectExternalControl,
|
||||
} from "../tools/websocket";
|
||||
import { LogicalSize, getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import ButtonWithTip from "./common/ButtonWithTip.vue";
|
||||
|
@ -9,8 +9,8 @@ import {
|
||||
clearShortcuts,
|
||||
listenToEvent,
|
||||
unlistenToEvent,
|
||||
} from "../hotkey";
|
||||
import { KeySteeringWheel } from "../keyMappingConfig";
|
||||
} from "../tools/hotkey";
|
||||
import { KeySteeringWheel } from "../tools/keyMappingConfig";
|
||||
import ScreenStream from "./ScreenStream.vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { secondaryClean, secondaryInit } from "../tools/init";
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { onBeforeUnmount, onMounted, ref } from "vue";
|
||||
import { useGlobalStore } from "../store/global";
|
||||
import { MessageReactive, useMessage } from "naive-ui";
|
||||
import { ScreenStream } from "../screenStream";
|
||||
import { ScreenStream } from "../tools/screenStream";
|
||||
import { NonReactiveStore } from "../store/noneReactiveStore";
|
||||
|
||||
const store = useGlobalStore();
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
KeySwipe as KeyMappingKeySwipe,
|
||||
KeySight as KeyMappingKeySight,
|
||||
KeyFire as KeyMappingKeyFire,
|
||||
} from "../../keyMappingConfig";
|
||||
} from "../../tools/keyMappingConfig";
|
||||
import { useGlobalStore } from "../../store/global";
|
||||
import { DropdownOption, NDropdown, useDialog, useMessage } from "naive-ui";
|
||||
import { onBeforeRouteLeave } from "vue-router";
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
NInputNumber,
|
||||
} from "naive-ui";
|
||||
import { CloseCircle, Settings } from "@vicons/ionicons5";
|
||||
import { KeyCommon, KeyMacro, KeyMacroList } from "../../keyMappingConfig";
|
||||
import { KeyCommon, KeyMacro, KeyMacroList } from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
NCheckbox,
|
||||
} from "naive-ui";
|
||||
import { CloseCircle, Settings } from "@vicons/ionicons5";
|
||||
import { KeyFire } from "../../keyMappingConfig";
|
||||
import { KeyFire } from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -3,7 +3,7 @@ import { computed, ref } from "vue";
|
||||
import { useGlobalStore } from "../../store/global";
|
||||
import { NIcon, NButton, NFormItem, NInput, NH4, NInputNumber } from "naive-ui";
|
||||
import { Eye, CloseCircle, Settings } from "@vicons/ionicons5";
|
||||
import { KeyObservation } from "../../keyMappingConfig";
|
||||
import { KeyObservation } from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -14,8 +14,8 @@ import {
|
||||
} from "naive-ui";
|
||||
import { computed, onActivated, onMounted, ref, watch } from "vue";
|
||||
import { useGlobalStore } from "../../store/global";
|
||||
import { loadDefaultKeyconfig } from "../../invoke";
|
||||
import { KeyMappingConfig } from "../../keyMappingConfig";
|
||||
import { loadDefaultKeyconfig } from "../../tools/invoke";
|
||||
import { KeyMappingConfig } from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
|
@ -3,7 +3,7 @@ import { computed, ref } from "vue";
|
||||
import { useGlobalStore } from "../../store/global";
|
||||
import { NIcon, NButton, NFormItem, NInput, NH4, NInputNumber } from "naive-ui";
|
||||
import { CloseCircle, Settings } from "@vicons/ionicons5";
|
||||
import { KeySight } from "../../keyMappingConfig";
|
||||
import { KeySight } from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
KeyDirectionalSkill,
|
||||
KeySkill,
|
||||
KeyTriggerWhenPressedSkill,
|
||||
} from "../../keyMappingConfig";
|
||||
} from "../../tools/keyMappingConfig";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { useGlobalStore } from "../../store/global";
|
||||
import { KeySteeringWheel } from "../../keyMappingConfig";
|
||||
import { KeySteeringWheel } from "../../tools/keyMappingConfig";
|
||||
import { NButton, NFormItem, NH4, NIcon, NInput, NInputNumber } from "naive-ui";
|
||||
import { CloseCircle, Move, Settings } from "@vicons/ionicons5";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
} from "naive-ui";
|
||||
import { Analytics, CloseCircle, Settings } from "@vicons/ionicons5";
|
||||
import { useKeyboardStore } from "../../store/keyboard";
|
||||
import { KeySwipe } from "../../keyMappingConfig";
|
||||
import { KeySwipe } from "../../tools/keyMappingConfig";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -4,9 +4,9 @@ import {
|
||||
KeyMapping,
|
||||
KeyMappingConfig,
|
||||
KeySteeringWheel,
|
||||
} from "../keyMappingConfig";
|
||||
} from "../tools/keyMappingConfig";
|
||||
import { LocalStore } from "./localStore";
|
||||
import { setAdbPath } from "../invoke";
|
||||
import { setAdbPath } from "../tools/invoke";
|
||||
import i18n, { allLanguage } from "../i18n";
|
||||
import { LogicalPosition, LogicalSize } from "@tauri-apps/api/dpi";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { load, Store } from "@tauri-apps/plugin-store";
|
||||
import { KeyMappingConfig } from "../keyMappingConfig";
|
||||
import { KeyMappingConfig } from "../tools/keyMappingConfig";
|
||||
import { useGlobalStore } from "./global";
|
||||
import { setAdbPath } from "../invoke";
|
||||
import { setAdbPath } from "../tools/invoke";
|
||||
import { allLanguage } from "../i18n";
|
||||
import { locale } from "@tauri-apps/plugin-os";
|
||||
import { NonReactiveStore } from "./noneReactiveStore";
|
||||
|
@ -4,9 +4,11 @@ import { h } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { fetch } from "@tauri-apps/plugin-http";
|
||||
import { compareVersion } from "./tools";
|
||||
import { checkAdbAvailable } from "../invoke";
|
||||
import { checkAdbAvailable } from "./invoke";
|
||||
|
||||
// TODO use markdown to render update info
|
||||
// TODO check screen stream available
|
||||
|
||||
function renderUpdateInfo(content: string) {
|
||||
const pList = content.split("\r\n").map((line: string) => h("p", line));
|
||||
return h("div", { style: "margin: 20px 0" }, pList);
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
TouchAction,
|
||||
swipe,
|
||||
touch,
|
||||
} from "./frontcommand/scrcpyMaskCmd";
|
||||
} from "../frontcommand/scrcpyMaskCmd";
|
||||
import {
|
||||
KeyCancelSkill,
|
||||
KeyDirectionalSkill,
|
||||
@ -22,18 +22,18 @@ import {
|
||||
KeyTriggerWhenDoublePressedSkill,
|
||||
KeyTriggerWhenPressedSkill,
|
||||
} from "./keyMappingConfig";
|
||||
import { useGlobalStore } from "./store/global";
|
||||
import { useGlobalStore } from "../store/global";
|
||||
import { LogicalPosition, getCurrentWindow } from "@tauri-apps/api/window";
|
||||
import { readText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { KeyToCodeMap } from "./frontcommand/KeyToCodeMap";
|
||||
import { KeyToCodeMap } from "../frontcommand/KeyToCodeMap";
|
||||
import {
|
||||
AndroidKeyEventAction,
|
||||
AndroidMetastate,
|
||||
} from "./frontcommand/android";
|
||||
import { UIEventsCode } from "./frontcommand/UIEventsCode";
|
||||
import { sendInjectKeycode, sendSetClipboard } from "./frontcommand/controlMsg";
|
||||
import { NonReactiveStore } from "./store/noneReactiveStore";
|
||||
} from "../frontcommand/android";
|
||||
import { UIEventsCode } from "../frontcommand/UIEventsCode";
|
||||
import { sendInjectKeycode, sendSetClipboard } from "../frontcommand/controlMsg";
|
||||
import { NonReactiveStore } from "../store/noneReactiveStore";
|
||||
|
||||
function clientxToPosx(clientx: number) {
|
||||
return clientx < 70
|
@ -1,6 +1,6 @@
|
||||
import { useMessage } from "naive-ui";
|
||||
import { useGlobalStore } from "./store/global";
|
||||
import { sendKey, shutdown, swipe, touch } from "./frontcommand/scrcpyMaskCmd";
|
||||
import { useGlobalStore } from "../store/global";
|
||||
import { sendKey, shutdown, swipe, touch } from "../frontcommand/scrcpyMaskCmd";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
let ws: WebSocket;
|
Loading…
Reference in New Issue
Block a user