let on_kbd ~key:k ~x:x ~y:y =
  ( match k with
      | 113
      | 27 ->  exit 0
      | 105 -> lx := !lx +. lstep ; Glut.postRedisplay ()
      | 107 -> lx := !lx -. lstep ; Glut.postRedisplay ()
      | 111 -> ly := !ly +. lstep ; Glut.postRedisplay ()
      | 108 -> ly := !ly -. lstep ; Glut.postRedisplay ()
      | 112 -> lz := !lz +. lstep ; Glut.postRedisplay ()
      | 109 -> lz := !lz -. lstep ; Glut.postRedisplay ()
      | 115 ->
          grid_step := !grid_step +. 0.01; Visu.set_step_mb !grid_step ;
          Glut.postRedisplay ()
      | 122 ->
          grid_step := !grid_step -. 0.01; Visu.set_step_mb !grid_step ;
          Glut.postRedisplay ()
      | 32 when !walk -> walk_step ()
      | _ -> Printf.printf "Unknown key pressed: %d\n%!" k )