fix(common): avoid duplicate key input coming from phyiscal buttons

This commit is contained in:
2026-02-24 00:17:10 +01:00
parent 8456fc0bd9
commit 6816f173eb
5 changed files with 6 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ const props = defineProps<{
opacity?: number;
bLabel: string;
aLabel: string;
noKeyboardA?: boolean;
}>();
const emit = defineEmits<{
@@ -135,9 +136,8 @@ useKeyDown(({ key, repeated }) => {
switch (key) {
case "NDS_START":
case "NDS_A":
emit("activateA");
if (!props.noKeyboardA) emit("activateA");
break;
case "NDS_B":
emit("activateB");
break;

View File

@@ -159,6 +159,7 @@ onRender((ctx) => {
"
:b-label="$t('common.quit')"
:a-label="$t(`contact.actions.${BUTTONS[selected].action}`)"
no-keyboard-a
@activate-a="handleActivateA(selected)"
@activate-b="handleActivateB"
/>

View File

@@ -333,6 +333,7 @@ const handleActivateB = () => {
:y-offset="store.barOffsetY + store.submenuButtonsOffsetY"
:b-label="isSubmenuSelected ? $t('common.goBack') : $t('common.quit')"
:a-label="$t('common.select')"
no-keyboard-a
@activate-a="handleActivateA()"
@activate-b="handleActivateB()"
/>

View File

@@ -225,6 +225,7 @@ defineOptions({
:y-offset="confirmationModal.buttonsYOffset + store.submenuButtonsOffsetY"
:b-label="bLabel"
:a-label="aLabel"
no-keyboard-a
@activate-a="handleActivateA"
@activate-b="handleActivateB"
/>

View File

@@ -196,6 +196,7 @@ onRender((ctx) => {
:y-offset="confirmationModal.buttonsYOffset + store.submenuButtonsOffsetY"
:b-label="bLabel"
:a-label="aLabel"
no-keyboard-a
@activate-a="handleActivateA"
@activate-b="handleActivateB"
/>