From c0cc2d9a5e37be91550024f72915856061352113 Mon Sep 17 00:00:00 2001 From: Jin Date: Wed, 3 Aug 2016 20:16:30 +0200 Subject: [PATCH] use the space bar to pause/start autopilot --- src/views/map/autopilot.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/map/autopilot.js b/src/views/map/autopilot.js index 9351a7f..2f481cf 100644 --- a/src/views/map/autopilot.js +++ b/src/views/map/autopilot.js @@ -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() + } + } }) }