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 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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue