From 83e65fb1b02e9b248572becbbec0c1627f68c137 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 19 Dec 2024 22:45:49 +0000 Subject: [PATCH] Restrict hotkey firing to initialpress --- src/Dodge/Creature/YourControl.hs | 3 ++- src/Dodge/HeldUse.hs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dodge/Creature/YourControl.hs b/src/Dodge/Creature/YourControl.hs index c322fe034..800768793 100644 --- a/src/Dodge/Creature/YourControl.hs +++ b/src/Dodge/Creature/YourControl.hs @@ -46,7 +46,8 @@ handleHotkeys w | SDL.ScancodeLShift `M.member` _pressedKeys (_input w) || SDL.ScancodeRShift `M.member` _pressedKeys (_input w) = foldl' tryAssignHotkey w allHotkeys - | otherwise = foldl' useHotkey w (M.intersection thehotkeys (w ^. input . pressedKeys)) + | otherwise = foldl' useHotkey w + (M.intersection thehotkeys (M.filter (== InitialPress) (w ^. input . pressedKeys))) where thehotkeys = M.mapKeys hotkeyToScancode $ w ^. cWorld . lWorld . hotkeys diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 4e163f16f..4921e4a80 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -8,7 +8,6 @@ module Dodge.HeldUse ( ) where import NewInt -import Dodge.Luse import Dodge.Creature.Action.Blink import Dodge.RadarSweep import Color