fix medidate key
This commit is contained in:
parent
f6ca371676
commit
3f4c1b063e
1 changed files with 6 additions and 3 deletions
|
|
@ -103,14 +103,17 @@ let send_action state action =
|
||||||
|
|
||||||
let kb_handler ev =
|
let kb_handler ev =
|
||||||
let open State in
|
let open State in
|
||||||
|
let ev = Ev.as_type ev in
|
||||||
let act =
|
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
|
| "KeyW" | "ArrowUp" -> Move Up
|
||||||
| "KeyA" | "ArrowLeft" -> Move Left
|
| "KeyA" | "ArrowLeft" -> Move Left
|
||||||
| "KeyS" | "ArrowDown" -> Move Down
|
| "KeyS" | "ArrowDown" -> Move Down
|
||||||
| "KeyD" | "ArrowRight" -> Move Right
|
| "KeyD" | "ArrowRight" -> Move Right
|
||||||
| "KeyM" -> Meditate
|
| _code -> (
|
||||||
| _s -> Do_nothing
|
match Ev.Keyboard.key ev |> Jstr.to_string with
|
||||||
|
| "m" -> Meditate
|
||||||
|
| _key -> Do_nothing )
|
||||||
in
|
in
|
||||||
Queue.add act input_queue
|
Queue.add act input_queue
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue