62 lines
1.7 KiB
Haskell
62 lines
1.7 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
--{-# LANGUAGE OverloadedStrings #-}
|
|
module Dodge.Config.KeyConfig
|
|
( KeyConfigSDL (..)
|
|
, defaultKeyConfigSDL
|
|
, loadKeyConfig
|
|
)
|
|
where
|
|
--import Data.Aeson
|
|
--import Foreign.C.Types
|
|
import GHC.Generics
|
|
--import qualified GHC.Int
|
|
import qualified SDL
|
|
--import qualified SDL.Internal.Numbered
|
|
--import System.Directory
|
|
|
|
data KeyConfigSDL = KeyConfigSDL
|
|
{ moveUpKey :: SDL.Scancode
|
|
, moveDownKey :: SDL.Scancode
|
|
, moveLeftKey :: SDL.Scancode
|
|
, moveRightKey :: SDL.Scancode
|
|
, pauseKey :: SDL.Scancode
|
|
, escapeKey :: SDL.Scancode
|
|
, dropItemKey :: SDL.Scancode
|
|
, toggleMapKey :: SDL.Scancode
|
|
, reloadKey :: SDL.Scancode
|
|
, testEventKey :: SDL.Scancode
|
|
, spaceActionKey :: SDL.Scancode
|
|
, rotateCameraPlusKey :: SDL.Scancode
|
|
, rotateCameraMinusKey :: SDL.Scancode
|
|
, zoomInKey :: SDL.Scancode
|
|
, zoomOutKey :: SDL.Scancode
|
|
, newMapKey :: SDL.Scancode
|
|
, modifierKey :: SDL.Scancode
|
|
}
|
|
deriving (Generic, Show)
|
|
|
|
defaultKeyConfigSDL :: KeyConfigSDL
|
|
defaultKeyConfigSDL =
|
|
KeyConfigSDL
|
|
{ moveUpKey = SDL.ScancodeW
|
|
, moveDownKey = SDL.ScancodeS
|
|
, moveLeftKey = SDL.ScancodeA
|
|
, moveRightKey = SDL.ScancodeD
|
|
, pauseKey = SDL.ScancodeP
|
|
, escapeKey = SDL.ScancodeEscape
|
|
, dropItemKey = SDL.ScancodeF
|
|
, toggleMapKey = SDL.ScancodeM
|
|
, reloadKey = SDL.ScancodeR
|
|
, testEventKey = SDL.ScancodeT
|
|
, spaceActionKey = SDL.ScancodeSpace
|
|
, rotateCameraPlusKey = SDL.ScancodeQ
|
|
, rotateCameraMinusKey = SDL.ScancodeE
|
|
, zoomInKey = SDL.ScancodeJ
|
|
, zoomOutKey = SDL.ScancodeK
|
|
, newMapKey = SDL.ScancodeN
|
|
, modifierKey = SDL.ScancodeCapsLock
|
|
}
|
|
|
|
loadKeyConfig :: IO KeyConfigSDL
|
|
loadKeyConfig = return defaultKeyConfigSDL
|