Skip to content

Commit

Permalink
use the space bar to pause/start autopilot
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangjin committed Aug 3, 2016
1 parent 0da03a0 commit c0cc2d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/views/map/autopilot.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class Autopilot extends Component {
if (keyCode === 27 && this.isModalOpen) {
this.handleCancelAutopilot()
}
// use the space bar to pause/start autopilot
if (keyCode == 32) {
if (autopilot.running && !autopilot.paused) {
autopilot.pause()
} else if (autopilot.paused) {
autopilot.start()
}
}
})
}

Expand Down

0 comments on commit c0cc2d9

Please sign in to comment.