diff options
author | Marc Sunet <jeannekamikaze@gmail.com> | 2012-08-27 20:10:06 +0200 |
---|---|---|
committer | Marc Sunet <jeannekamikaze@gmail.com> | 2012-08-27 20:10:06 +0200 |
commit | c5b7ec13df9787441b635c80c4edabc8ad23fc36 (patch) | |
tree | ca3ba66db5c1bebd524a34f446054eaa1c42ba64 | |
parent | 387709271b6eaaec76c79143838a25432cc3ba64 (diff) |
Added newDMS
-rw-r--r-- | Spear/App/Input.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Spear/App/Input.hs b/Spear/App/Input.hs index ef678d6..07e7189 100644 --- a/Spear/App/Input.hs +++ b/Spear/App/Input.hs | |||
@@ -20,6 +20,7 @@ module Spear.App.Input | |||
20 | , toggledMouse | 20 | , toggledMouse |
21 | , toggledKeyboard | 21 | , toggledKeyboard |
22 | -- * Delayed input | 22 | -- * Delayed input |
23 | , newDMS | ||
23 | , delayedMouse | 24 | , delayedMouse |
24 | ) | 25 | ) |
25 | where | 26 | where |
@@ -170,6 +171,10 @@ type ButtonDelay = MouseButton -> Float | |||
170 | newtype DelayedMouseState = DelayedMouseState (V.Vector Float) | 171 | newtype DelayedMouseState = DelayedMouseState (V.Vector Float) |
171 | 172 | ||
172 | 173 | ||
174 | newDMS :: DelayedMouseState | ||
175 | newDMS = DelayedMouseState $ V.replicate (fromEnum (maxBound :: MouseButton)) 0 | ||
176 | |||
177 | |||
173 | delayedMouse :: ButtonDelay -- ^ Delay configuration for each button. | 178 | delayedMouse :: ButtonDelay -- ^ Delay configuration for each button. |
174 | -> Mouse -- ^ Current mouse state. | 179 | -> Mouse -- ^ Current mouse state. |
175 | -> Float -- ^ Time elapsed since last udpate. | 180 | -> Float -- ^ Time elapsed since last udpate. |