Continue mouse refactor, add explicit release event/timer

This commit is contained in:
2024-11-19 12:00:31 +00:00
parent 5b709cd7ba
commit e31f6dfd4b
10 changed files with 97 additions and 75 deletions
+2
View File
@@ -63,8 +63,10 @@ handleMouseWheelEvent mwev = scrollAmount +~ fromIntegral y
handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input
handleMouseButtonEvent mbev theinput = case mouseButtonEventMotion mbev of
Released -> theinput & mouseButtons . at thebutton .~ Nothing
& mouseButtonsReleased . at thebutton ?~ 0
Pressed -> theinput
& mouseButtons . at thebutton ?~ 0
& mouseButtonsReleased . at thebutton .~ Nothing
& clickPos . at thebutton ?~ (theinput ^. mousePos)
-- note that mouse button down events are NOT repeating
where