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