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:
@@ -42,6 +42,7 @@ data ItemSF -- Structural Function
|
||||
| CapacitorSF
|
||||
| TransformerSF
|
||||
| PulseBallSF
|
||||
| TorchSF
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
type CItem = (Item, ItemSF)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,7 +31,7 @@ data WdWd
|
||||
| WdWdNegateTrig Int
|
||||
-- | WdWdFromItCrixWdWd (LabelDoubleTree ComposeLinkType Item) Int ItCrWdWd
|
||||
| MakeTempLight LSParam Int
|
||||
| UseInvItem Int PressType
|
||||
| UseInvItem Int Int -- invid presstime
|
||||
| WdWdBurstFireRepetition Int Int
|
||||
--deriving (Eq, Show, Read) --, Generic)
|
||||
--h--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
Reference in New Issue
Block a user