Unify key press and mouse button press timings

Both now use Ints for presses.
Still no release timer for keyboard events.
This commit is contained in:
2025-07-28 23:16:05 +01:00
parent ea35753744
commit 81f88c32e9
15 changed files with 52 additions and 58 deletions
+2 -5
View File
@@ -67,7 +67,7 @@ handleHotkeys w
thehotkeys = M.mapKeys hotkeyToScancode $ w ^. cWorld . lWorld . hotkeys
lw = w ^. cWorld . lWorld
useHotkey :: World -> (NewInt ItmInt, PressType) -> World
useHotkey :: World -> (NewInt ItmInt, Int) -> World
useHotkey w (NInt itid, pt) = fromMaybe w $ do
invid <- w ^? cWorld . lWorld . itemLocations . ix itid . ilInvID
useItem invid pt w
@@ -228,8 +228,5 @@ tryClickUse pkeys w = fromMaybe w $ do
. crManipulation
. manObject
. imSelectedItem of
Just invid -> useItem invid (f ltime) w
Just invid -> useItem invid ltime w
Nothing -> interactWithCloseObj <$> getSelectedCloseObj w ?? w
where
f 0 = InitialPress
f _ = ShortPress