fix(nds): input fighting

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

View File

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

View File

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

View File

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