From 7f96f69fb59e4fa17eff16d829833e8d82150baf Mon Sep 17 00:00:00 2001 From: "opacity@t-win.kr" Date: Wed, 27 Aug 2025 18:25:00 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"=EB=94=94=EB=B2=84=EA=B7=B8?= =?UTF-8?q?=ED=8C=A8=EB=84=90=EC=88=98=EC=A0=95=20=EB=94=A5=EB=A7=81?= =?UTF-8?q?=ED=81=AC=EC=A0=95=EB=B3=B4=EC=B6=94=EA=B0=80""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 33ec7d2a845a1dfa3f7465563ab2bfdad8ef4344. --- .../src/hooks/useDebugKey.js | 29 ++++++++++++++++--- .../src/views/DebugPanel/DebugPanel.jsx | 23 ++++++++++++++- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/com.twin.app.shoptime/src/hooks/useDebugKey.js b/com.twin.app.shoptime/src/hooks/useDebugKey.js index 347a4ee2..58fc5906 100644 --- a/com.twin.app.shoptime/src/hooks/useDebugKey.js +++ b/com.twin.app.shoptime/src/hooks/useDebugKey.js @@ -6,6 +6,7 @@ import { off, on } from "@enact/core/dispatcher"; import { pushPanel } from "../actions/panelActions"; import * as Config from "../utils/Config"; +import KeyCode from "../utils/KeyCode"; const useDebugKey = ({ isLandingPage = false }) => { const panels = useSelector((state) => state.panels.panels); @@ -15,7 +16,7 @@ const useDebugKey = ({ isLandingPage = false }) => { const dispatch = useDispatch(); const isPrdServer = useMemo(() => { - if(typeof window === "object" && !window.PalmSystem ){ + if (typeof window === "object" && !window.PalmSystem) { return false; } @@ -39,14 +40,34 @@ const useDebugKey = ({ isLandingPage = false }) => { if (isLandingPage && panels && panels.length > 0) { return; } - if (ev && ev.key >= 0 && ev.key <= 9) { + + // TV 환경에서는 keyCode를 사용하고, 웹 환경에서는 key를 사용 + let keyPressed = null; + + // TV 환경 (webOS)에서 리모컨 숫자 키 처리 + if (typeof window === "object" && window.PalmSystem) { + // TV 리모컨 숫자 키 코드 (48-57: 0-9) + if (ev.keyCode >= KeyCode.NUM_0 && ev.keyCode <= KeyCode.NUM_9) { + keyPressed = String(ev.keyCode - KeyCode.NUM_0); + } + } else { + // 웹 환경에서 키보드 숫자 키 처리 + if (ev && ev.key >= "0" && ev.key <= "9") { + keyPressed = ev.key; + } + } + + if (keyPressed !== null) { if (debugKey.current.length >= Config.DEBUG_KEY.length) { debugKey.current.shift(); } - debugKey.current.push(String(ev.key)); + debugKey.current.push(keyPressed); + if (debugKey.current.join("") === Config.DEBUG_KEY) { debugKey.current = []; - dispatch(pushPanel({ name: Config.panel_names.DEBUG_PANEL, panelInfo: {} })); + dispatch( + pushPanel({ name: Config.panel_names.DEBUG_PANEL, panelInfo: {} }) + ); } if (debugKey.current.join("") === Config.TESTPANEL_KEY) { debugKey.current = []; diff --git a/com.twin.app.shoptime/src/views/DebugPanel/DebugPanel.jsx b/com.twin.app.shoptime/src/views/DebugPanel/DebugPanel.jsx index 52660eec..86b0ed7e 100644 --- a/com.twin.app.shoptime/src/views/DebugPanel/DebugPanel.jsx +++ b/com.twin.app.shoptime/src/views/DebugPanel/DebugPanel.jsx @@ -24,6 +24,8 @@ export default function DebugPanel({ spotlightId }) { const appStatus = useSelector((state) => state.common.appStatus); const httpHeader = useSelector((state) => state.common.httpHeader); const localSettings = useSelector((state) => state.localSettings); + const deepLinkInfo = useSelector((state) => state.common.deepLinkInfo); + const secondLayerInfo = useSelector((state) => state.common.secondLayerInfo); const infos = useMemo(() => { let v = []; v.push({ title: "Version(App)", value: appinfo.version }); @@ -35,8 +37,27 @@ export default function DebugPanel({ spotlightId }) { v.push({ title: "httpHeader", value: JSON.stringify(httpHeader) }); v.push({ title: "href", value: window.location.href }); v.push({ title: " ", value: " " }); + // DeepLink 관련 정보 + v.push({ title: "=== DeepLink Info ===", value: " " }); + v.push({ + title: "deepLinkInfo", + value: JSON.stringify(deepLinkInfo), + }); + v.push({ + title: "isDeepLink", + value: String(deepLinkInfo.isDeepLink), + }); + v.push({ + title: "contentTarget", + value: deepLinkInfo.contentTarget || "N/A", + }); + v.push({ + title: "secondLayerInfo", + value: JSON.stringify(secondLayerInfo), + }); + v.push({ title: " ", value: " " }); return v; - }, [appStatus, httpHeader]); + }, [appStatus, httpHeader, deepLinkInfo, secondLayerInfo]); useEffect(() => { dispatch(setHidePopup());