fix(nds): input fighting

This commit is contained in:
2026-02-25 23:57:37 +01:00
parent 2d39c7bebd
commit ea2547425a
3 changed files with 7 additions and 8 deletions

View File

@@ -38,7 +38,6 @@ onMounted(() => {
? 'opacity-100 text-highlighted' ? 'opacity-100 text-highlighted'
: 'opacity-50 hover:opacity-100', : 'opacity-50 hover:opacity-100',
]" ]"
@keydown.up.prevent="open = true"
/> />
</template> </template>
@@ -51,6 +50,8 @@ onMounted(() => {
:step="2" :step="2"
orientation="vertical" orientation="vertical"
color="neutral" color="neutral"
@keydown.prevent
@mouseup="($event.target as HTMLElement).blur()"
@update:model-value=" @update:model-value="
(v) => { (v) => {
app.settings.volume = (v ?? 100) / 100; app.settings.volume = (v ?? 100) / 100;

View File

@@ -13,12 +13,10 @@ export const useKeyDown = (callback: KeyDownCallback) => {
if (app.lagDetected) return; if (app.lagDetected) return;
const ndsButton = mapCodeToNDS(event.code); const ndsButton = mapCodeToNDS(event.code);
if ( if (ndsButton && document.activeElement && document.activeElement !== document.body) {
ndsButton && (document.activeElement as HTMLElement).blur();
document.activeElement && }
document.activeElement !== document.body
)
return;
callback({ callback({
key: ndsButton ? `NDS_${ndsButton}` : event.key, key: ndsButton ? `NDS_${ndsButton}` : event.key,
ndsButton, ndsButton,

View File

@@ -68,7 +68,7 @@ export const useAppStore = defineStore("app", {
setRenderingMode(mode: Settings["renderingMode"]) { setRenderingMode(mode: Settings["renderingMode"]) {
this.ready = mode === "2d"; this.ready = mode === "2d";
this.settings.renderingMode = mode; this.settings.renderingMode = mode;
if (mode === "3d") this.lagDetected = false; this.lagDetected = false;
this.save(); this.save();
}, },