summaryrefslogtreecommitdiffstats
path: root/GLDriver.hs
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-02-24 03:40:06 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-02-24 03:40:06 +0100
commit7f12f41e5fce40042f97d167da9a0fb58e5a1651 (patch)
tree7a9ec269c62cc6616850fb2cb522378a3f1155bd /GLDriver.hs
parent4a6d841bc7e3b17bf399ae2e39d409fe85a6fffb (diff)
downloadhtanks-7f12f41e5fce40042f97d167da9a0fb58e5a1651.tar
htanks-7f12f41e5fce40042f97d167da9a0fb58e5a1651.zip
Added keyboard events
Diffstat (limited to 'GLDriver.hs')
-rw-r--r--GLDriver.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/GLDriver.hs b/GLDriver.hs
index 9fb2642..2b55c6f 100644
--- a/GLDriver.hs
+++ b/GLDriver.hs
@@ -4,9 +4,12 @@ module GLDriver ( Driver(..)
, SomeDriver(..)
, Event
, SomeEvent(..)
+ , fromEvent
, QuitEvent(..)
, ResizeEvent(..)
- , fromEvent
+ , Key(..)
+ , KeyPressEvent(..)
+ , KeyReleaseEvent(..)
) where
import Data.Typeable
@@ -45,3 +48,13 @@ instance Event QuitEvent
data ResizeEvent = ResizeEvent Int Int deriving Typeable
instance Event ResizeEvent
+
+
+data Key = KeyLeft | KeyRight | KeyUp | KeyDown
+ deriving (Eq, Ord, Show)
+
+data KeyPressEvent = KeyPressEvent Key deriving Typeable
+instance Event KeyPressEvent
+
+data KeyReleaseEvent = KeyReleaseEvent Key deriving Typeable
+instance Event KeyReleaseEvent