From 3abf8ad3308407f70a32c8cc840973172c3d84d7 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 24 May 2024 10:12:29 -0700 Subject: WASD controls. --- Demos/Pong/Main.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Demos/Pong/Main.hs b/Demos/Pong/Main.hs index 26ceefa..9f00643 100644 --- a/Demos/Pong/Main.hs +++ b/Demos/Pong/Main.hs @@ -113,10 +113,10 @@ resize (ResizeEvent w h) = } translateEvents = mapMaybe translateEvents' - where translateEvents' (KeyDown KEY_LEFT) = Just MoveLeft - translateEvents' (KeyDown KEY_RIGHT) = Just MoveRight - translateEvents' (KeyUp KEY_LEFT) = Just StopLeft - translateEvents' (KeyUp KEY_RIGHT) = Just StopRight - translateEvents' _ = Nothing + where translateEvents' (KeyDown KEY_A) = Just MoveLeft + translateEvents' (KeyDown KEY_D) = Just MoveRight + translateEvents' (KeyUp KEY_A) = Just StopLeft + translateEvents' (KeyUp KEY_D) = Just StopRight + translateEvents' _ = Nothing exitRequested = elem (KeyDown KEY_ESC) -- cgit v1.2.3