diff --git a/app/components/Achievements/BottomScreen.vue b/app/components/Achievements/BottomScreen.vue index 97f8626..4d70509 100644 --- a/app/components/Achievements/BottomScreen.vue +++ b/app/components/Achievements/BottomScreen.vue @@ -8,8 +8,8 @@ const QUIT_SIZE = assets.images.achievements.quit.rect.width; const QUIT_X = Math.floor(LOGICAL_WIDTH / 2 - QUIT_SIZE / 2); const QUIT_Y = 135; -useKeyDown(({ key }) => { - if (store.isIntro || store.isOutro) return; +useKeyDown(({ key, repeated }) => { + if (store.isIntro || store.isOutro || repeated) return; switch (key) { case "NDS_B": diff --git a/app/components/Common/Buttons.vue b/app/components/Common/Buttons.vue index 6f6d431..7353829 100644 --- a/app/components/Common/Buttons.vue +++ b/app/components/Common/Buttons.vue @@ -110,8 +110,8 @@ onClick((x, y) => { } }); -useKeyDown(({ key }) => { - if (props.yOffset !== 0) return; +useKeyDown(({ key, repeated }) => { + if (props.yOffset !== 0 || repeated) return; switch (key) { case "NDS_START": case "NDS_A": diff --git a/app/components/Contact/BottomScreen/BottomScreen.vue b/app/components/Contact/BottomScreen/BottomScreen.vue index 1822d57..e543690 100644 --- a/app/components/Contact/BottomScreen/BottomScreen.vue +++ b/app/components/Contact/BottomScreen/BottomScreen.vue @@ -56,6 +56,11 @@ const { selected, selectorPosition } = useButtonNavigation({ }, }); +const handleActivateB = () => { + if (store.isIntro || store.isOutro) return; + store.animateOutro(); +}; + const actionateButton = async (button: (typeof selected)["value"]) => { const [action, verbKey, content] = ACTIONS[button]; const verb = $t(verbKey); @@ -118,6 +123,6 @@ const actionateButton = async (button: (typeof selected)["value"]) => { " :b-label="$t('common.quit')" :a-label="$t(`contact.actions.${ACTIONS[selected][0]}`)" - @activate-b="store.animateOutro()" + @activate-b="handleActivateB" /> diff --git a/app/components/Projects/BottomScreen/Buttons.vue b/app/components/Projects/BottomScreen/Buttons.vue index 00b91fd..3605b60 100644 --- a/app/components/Projects/BottomScreen/Buttons.vue +++ b/app/components/Projects/BottomScreen/Buttons.vue @@ -162,7 +162,8 @@ onRender((ctx) => { ctx.fillStyle = `rgba(0, 0, 0, ${store.isIntro ? store.intro.fadeOpacity : store.isOutro ? store.outro.fadeOpacity : 0})`; ctx.fillRect(0, 0, LOGICAL_WIDTH, LOGICAL_HEIGHT); }); -useKeyDown(({ key }) => { + +useKeyDown(({ key, repeated }) => { if ( currentAnimation || store.isIntro || @@ -185,11 +186,15 @@ useKeyDown(({ key }) => { } break; case "NDS_B": + if (repeated) break; + startButtonAnimation("quit"); store.animateOutro(); break; case "NDS_A": case "NDS_START": + if (repeated) break; + startButtonAnimation("link"); setTimeout( () => (store.showConfirmationPopup = true), diff --git a/app/composables/useButtonNavigation.ts b/app/composables/useButtonNavigation.ts index 50b6fd9..d177a7d 100644 --- a/app/composables/useButtonNavigation.ts +++ b/app/composables/useButtonNavigation.ts @@ -221,8 +221,8 @@ export const useButtonNavigation = >({ } }); - useKeyDown(({ key }) => { - if (blockInteractions.value) return; + useKeyDown(({ key, repeated }) => { + if (blockInteractions.value || repeated) return; const currentButton = selectedButton.value as Entry; const currentNav = navigation[currentButton];