Implement floating camera
This commit is contained in:
@@ -12,6 +12,7 @@ import Dodge.Data.Config
|
||||
import Dodge.Data.Input
|
||||
import LensHelp
|
||||
import SDL
|
||||
--import qualified Data.Map.Strict as M
|
||||
|
||||
-- annoyingly, the text input event doesn't register backspace, so deletion has to be
|
||||
-- dealt with separately
|
||||
@@ -55,7 +56,8 @@ handleMouseWheelEvent mwev = scrollAmount +~ fromIntegral y
|
||||
|
||||
handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input
|
||||
handleMouseButtonEvent mbev = case mouseButtonEventMotion mbev of
|
||||
Released -> pointtothebutton .~ Nothing
|
||||
Pressed -> pointtothebutton ?~ False
|
||||
Released -> mouseButtons . at thebutton .~ Nothing
|
||||
Pressed -> mouseButtons . at thebutton ?~ 1 -- note that mouse button events are NOT repeating
|
||||
where
|
||||
pointtothebutton = mouseButtons . at (mouseButtonEventButton mbev)
|
||||
-- pointtothebutton = mouseButtons . at thebutton
|
||||
thebutton = mouseButtonEventButton mbev
|
||||
|
||||
Reference in New Issue
Block a user