Skip to content

Commit

Permalink
Merge pull request #338 from jiangjin/use-space-bar
Browse files Browse the repository at this point in the history
use the space bar to pause/start autopilot
  • Loading branch information
h4v1nfun authored Aug 11, 2016
2 parents d3d51c6 + c0cc2d9 commit 755f6db
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 755f6db

Please sign in to comment.