From 6200edea25feb0fb0d74cefbb53b29bde12de9b1 Mon Sep 17 00:00:00 2001 From: orangemug Date: Mon, 28 May 2018 12:03:47 +0100 Subject: [PATCH] Added initial shortcuts. --- src/components/App.jsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/components/App.jsx b/src/components/App.jsx index 78175034..4e776768 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -50,6 +50,43 @@ export default class App extends React.Component { onLocalStyleChange: mapStyle => this.onStyleChanged(mapStyle, false) }) + document.body.addEventListener("keyup", (e) => { + if(e.keyCode === 27) { + e.target.blur(); + document.body.focus(); + } + else if(document.activeElement === document.body) { + console.log(">>> e", e.keyCode); + if(e.keyCode === 191) { + console.log("TODO: SHORTCUTS"); + } + else if(e.keyCode === 79) { + console.log("TODO: OPEN"); + } + else if(e.keyCode === 69) { + console.log("TODO: EXPORT"); + } + else if(e.keyCode === 83) { + console.log("TODO: SOURCES"); + } + else if(e.keyCode === 80) { + console.log("TODO: METADATA"); + } + else if(e.keyCode === 73) { + console.log("TODO: INSPECT"); + } + else if(e.keyCode === 76) { + console.log("TODO: LAYER LIST"); + } + else if(e.keyCode === 67) { + console.log("TODO: CURRENT LAYER"); + } + else if(e.keyCode === 77) { + console.log("TODO: MAP"); + } + } + }) + const styleUrl = initialStyleUrl() if(styleUrl) { this.styleStore = new StyleStore()