Change keycode input to scancode
This commit is contained in:
@@ -98,23 +98,23 @@ zoomOutLongGun w | currentZoom > 0.5 = over (wpPointer . itAttachment . _Just .
|
||||
rotCam = rotateCameraL . rotateCameraR . zoomCamIn . zoomCamOut . autoZoomCam
|
||||
|
||||
rotateCameraL :: World -> World
|
||||
rotateCameraL w | SDL.KeycodeQ `S.member` _keys w
|
||||
rotateCameraL w | SDL.ScancodeQ `S.member` _keys w
|
||||
= w & cameraRot +~ 0.015
|
||||
& creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
|
||||
. itAttachment . _Just . scopePos %~ rotateV 0.015
|
||||
| otherwise = w
|
||||
rotateCameraR :: World -> World
|
||||
rotateCameraR w | SDL.KeycodeE `S.member` _keys w
|
||||
rotateCameraR w | SDL.ScancodeE `S.member` _keys w
|
||||
= w & cameraRot -~ 0.015
|
||||
& creatures . ix 0 . crInv . ix (_crInvSel (_creatures w IM.! 0))
|
||||
. itAttachment . _Just . scopePos %~ rotateV (-0.015)
|
||||
| otherwise = w
|
||||
zoomCamIn :: World -> World
|
||||
zoomCamIn w | SDL.KeycodeJ `S.member` _keys w
|
||||
zoomCamIn w | SDL.ScancodeJ `S.member` _keys w
|
||||
= w {_cameraZoom = _cameraZoom w + 0.01}
|
||||
| otherwise = w
|
||||
zoomCamOut :: World -> World
|
||||
zoomCamOut w | SDL.KeycodeK `S.member` _keys w
|
||||
zoomCamOut w | SDL.ScancodeK `S.member` _keys w
|
||||
= w {_cameraZoom = max (_cameraZoom w - 0.01) 0.01}
|
||||
| otherwise = w
|
||||
|
||||
|
||||
Reference in New Issue
Block a user