fix medidate key

This commit is contained in:
zapashcanon 2023-01-09 02:40:40 +01:00
parent f6ca371676
commit 3f4c1b063e
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1

View file

@ -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