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:
@@ -12,11 +12,11 @@ import SDL (MouseButton, Scancode)
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data PressType
|
||||
= InitialPress
|
||||
| ShortPress
|
||||
| LongPress
|
||||
deriving (Eq, Show)
|
||||
--data PressType
|
||||
-- = InitialPress Int
|
||||
-- | ShortPress Int
|
||||
-- | LongPress Int
|
||||
-- deriving (Eq, Show)
|
||||
|
||||
data MouseContext
|
||||
= NoMouseContext
|
||||
@@ -45,7 +45,7 @@ data Input = Input
|
||||
{ _mousePos :: Point2 -- in pixels, from the center of the screen
|
||||
, _mouseContext :: MouseContext
|
||||
, _mouseMoving :: Bool
|
||||
, _pressedKeys :: M.Map Scancode PressType
|
||||
, _pressedKeys :: M.Map Scancode Int
|
||||
, _mouseButtons :: M.Map MouseButton Int -- counts number of frames held down
|
||||
, _mouseButtonsReleased :: M.Map MouseButton Int -- counts number of frames released
|
||||
, _scrollAmount :: Int
|
||||
@@ -72,4 +72,4 @@ data TermSignal
|
||||
|
||||
makeLenses ''Input
|
||||
makeLenses ''MouseContext
|
||||
deriveJSON defaultOptions ''PressType
|
||||
--deriveJSON defaultOptions ''PressType
|
||||
|
||||
Reference in New Issue
Block a user