From 3f4c1b063e04eca850146c35f4241851dc68b6cb Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Mon, 9 Jan 2023 02:40:40 +0100 Subject: [PATCH] fix medidate key --- src/island_client.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/island_client.ml b/src/island_client.ml index d75855d..43f02cd 100644 --- a/src/island_client.ml +++ b/src/island_client.ml @@ -103,14 +103,17 @@ let send_action state action = let kb_handler ev = let open State in + let ev = Ev.as_type ev in let act = - match ev |> Ev.as_type |> Ev.Keyboard.code |> Jstr.to_string with + match Ev.Keyboard.code ev |> Jstr.to_string with | "KeyW" | "ArrowUp" -> Move Up | "KeyA" | "ArrowLeft" -> Move Left | "KeyS" | "ArrowDown" -> Move Down | "KeyD" | "ArrowRight" -> Move Right - | "KeyM" -> Meditate - | _s -> Do_nothing + | _code -> ( + match Ev.Keyboard.key ev |> Jstr.to_string with + | "m" -> Meditate + | _key -> Do_nothing ) in Queue.add act input_queue