@@ -8,14 +8,12 @@ import {
88 SettingsModal ,
99 ShortcutsPanel ,
1010 ToolbarMenu ,
11- settings ,
11+ PlayerFooter ,
1212 sha256Hex ,
1313 navEnabled ,
14- hasGamepad ,
1514 isTv ,
1615 useAutoHideToolbar ,
1716 useFullscreen ,
18- useInputMonitor ,
1917 useRemoteNav ,
2018 type SaveState ,
2119} from ' @nes-emulator/player'
@@ -60,14 +58,10 @@ useRemoteNav({
6058 onBack: consumeBack , // 主界面返回键 → 分级返回(JS 侧路径,'exit' 时走 process.exit)
6159})
6260
63- // 游戏运行(已载入且未暂停)时自动隐藏顶部工具栏,鼠标移到顶部/触屏点顶部唤出 ;
61+ // 游戏运行(已载入且未暂停)时自动隐藏顶部工具栏,点击顶部热区/把手唤出(所有平台统一用点击) ;
6462// TV/遥控无鼠标无触屏,靠暂停(paused → isPlaying 变假)调出工具栏。
6563const isPlaying = computed (() => !! romName .value && ! paused .value )
66- const {
67- visible : toolbarVisible,
68- handlePointerMove : onToolbarPointerMove,
69- toggle : toggleToolbar,
70- } = useAutoHideToolbar (isPlaying )
64+ const { visible : toolbarVisible, toggle : toggleToolbar } = useAutoHideToolbar (isPlaying )
7165
7266// 焦点环作用到全局(含 Teleport 到 body 的下拉菜单):TV 或已连手柄时给 <html> 标记 tv-nav。
7367if (typeof document !== ' undefined' ) {
@@ -80,9 +74,6 @@ if (typeof document !== 'undefined') {
8074const modKey: ' ctrl' | ' shift' = isTauri ? ' ctrl' : ' shift'
8175const modLabel = isTauri ? ' Ctrl' : ' Shift'
8276
83- // 调试:当前按下的按键(键盘/手柄/遥控),仅在设置开启时显示于状态栏。
84- const { label : inputLabel } = useInputMonitor ()
85-
8677async function openRom() {
8778 const picked = await pickRomFile ()
8879 if (! picked ) return
@@ -251,16 +242,17 @@ onBeforeUnmount(() => {
251242 'is-fullscreen': isFullscreen,
252243 'is-pseudo-fullscreen': isFullscreen && usePseudo,
253244 }"
254- @mousemove =" onToolbarPointerMove"
255245 >
256- <!-- 触屏顶部热区:工具栏隐藏时点此唤出(桌面用鼠标 hover) -->
257- <div v-if =" isPlaying" class =" toolbar-hotzone" @click =" toggleToolbar" />
246+ <!-- 触屏顶部热区:工具栏隐藏时点此唤出(桌面用鼠标 hover)。
247+ 用 pointerup 而非 click:部分 WebView 对无 cursor:pointer 的 <div> 不派发 click,
248+ pointer 事件不受此限,配合下方 cursor:pointer 确保各平台都能点。 -->
249+ <div v-if =" isPlaying" class =" toolbar-hotzone" @pointerup =" toggleToolbar" />
258250 <!-- 顶部唤出手柄:游戏时工具栏自动隐藏,点此(或桌面把鼠标移到顶部)滑出菜单栏。 -->
259251 <button
260252 v-if =" isPlaying && !toolbarVisible"
261253 class =" toolbar-handle"
262254 title =" 显示菜单栏"
263- @click =" toggleToolbar"
255+ @pointerup =" toggleToolbar"
264256 >
265257 ☰
266258 </button >
@@ -333,14 +325,11 @@ onBeforeUnmount(() => {
333325 <div v-if =" exitHintVisible" class =" exit-hint" role =" status" >再按一次返回键退出</div >
334326 </Transition >
335327
336- <footer class =" footer" >
337- <button class =" link-btn" @click =" helpOpen = true" >查看所有快捷键</button >
338- <span v-if =" navEnabled && !hasGamepad" class =" tv-tip" >游戏操作需连接手柄;遥控器用于菜单导航,返回键退出</span >
339- <span v-if =" settings.misc.showInputDebug" class =" input-debug" >
340- 按键 <b >{{ inputLabel || '—' }}</b >
341- </span >
342- <span class =" meta" >{{ romName ?? '未载入' }} · {{ isTauri ? 'Tauri App' : '浏览器预览' }}</span >
343- </footer >
328+ <PlayerFooter
329+ :rom-name =" romName "
330+ :platform-label =" isTauri ? ' Tauri App' : ' 浏览器预览' "
331+ @help =" helpOpen = true "
332+ />
344333 </div >
345334</template >
346335
@@ -440,6 +429,10 @@ textarea,
440429 right : 0 ;
441430 height : 52px ;
442431 z-index : 400 ;
432+ /* 部分 WebView 需 cursor:pointer 才把 <div> 视作可点击并派发点击;
433+ touch-action:manipulation 去掉双击缩放延迟,点顶部唤出更跟手。 */
434+ cursor : pointer ;
435+ touch-action : manipulation ;
443436}
444437/* 顶部唤出手柄:游戏时工具栏隐藏才出现,点击滑出菜单栏(所有平台可见,便于发现)。 */
445438.toolbar-handle {
@@ -520,45 +513,6 @@ textarea,
520513 font-size : 13px ;
521514 text-align : center ;
522515}
523- .footer {
524- display : flex ;
525- align-items : center ;
526- justify-content : space-between ;
527- flex-wrap : wrap ;
528- gap : 8px ;
529- padding : 8px 16px ;
530- background : #242424 ;
531- border-top : 1px solid #343434 ;
532- color : #aaa ;
533- font-size : 12px ;
534- }
535- .footer .meta {
536- color : #777 ;
537- margin-left : auto ;
538- }
539- /* 调试:当前按下的按键 */
540- .footer .input-debug {
541- color : #888 ;
542- font-family : ui-monospace , ' Cascadia Code' , monospace ;
543- }
544- .footer .input-debug b {
545- color : #6ab0ff ;
546- font-weight : 600 ;
547- }
548- .footer .tv-tip {
549- color : #6ab0ff ;
550- }
551- .link-btn {
552- border : none ;
553- background : transparent ;
554- color : #6ab0ff ;
555- cursor : pointer ;
556- font-size : 12px ;
557- padding : 0 ;
558- }
559- .link-btn :hover {
560- text-decoration : underline ;
561- }
562516.exit-hint {
563517 position : fixed ;
564518 left : 50% ;
0 commit comments