Skip to content

Commit 4dd8c53

Browse files
committed
🐞 fix: 去除多余快捷键功能
1 parent e6353e8 commit 4dd8c53

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

src/components/Player/FullPlayer.vue

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@
9797
<script setup lang="ts">
9898
import { useMobile } from "@/composables/useMobile";
9999
import { useStatusStore, useMusicStore, useSettingStore } from "@/stores";
100-
import { usePlayerController } from "@/core/player/PlayerController";
101100
import { isElectron } from "@/utils/env";
102101
103102
const musicStore = useMusicStore();
104103
const statusStore = useStatusStore();
105104
const settingStore = useSettingStore();
106-
const player = usePlayerController();
107105
108106
const { isTablet } = useMobile();
109107
@@ -216,34 +214,6 @@ watch(
216214
},
217215
);
218216
219-
// 键盘控制
220-
const onKeydown = (e: KeyboardEvent) => {
221-
if (e.code === "Space") {
222-
const activeElement = document.activeElement as HTMLElement;
223-
// 如果焦点在输入框、文本域或任何可编辑元素上,则不响应
224-
if (
225-
activeElement &&
226-
(activeElement.tagName === "INPUT" ||
227-
activeElement.tagName === "TEXTAREA" ||
228-
activeElement.isContentEditable)
229-
) {
230-
return;
231-
}
232-
e.preventDefault();
233-
player.playOrPause();
234-
}
235-
};
236-
237-
// 监听全屏状态
238-
watchEffect((onCleanup) => {
239-
if (statusStore.showFullPlayer) {
240-
window.addEventListener("keydown", onKeydown);
241-
onCleanup(() => {
242-
window.removeEventListener("keydown", onKeydown);
243-
});
244-
}
245-
});
246-
247217
onMounted(() => {
248218
mainCoverColor.value = statusStore.mainColor;
249219
// 阻止息屏

0 commit comments

Comments
 (0)