diff --git a/js/services.js b/js/services.js index 6863f55519d..76971f32d2c 100644 --- a/js/services.js +++ b/js/services.js @@ -106,4 +106,17 @@ angular.module('kibana.services', []) timers = new Array(); } -}); +}) +.service('keylistener', function($rootScope) { + var keys = []; + $(document).keydown(function (e) { + console.log("keydown", e.which); + keys[e.which] = true; + }); + + $(document).keyup(function (e) { + console.log("keyup", e.which); + delete keys[e.which]; + }); + + }); diff --git a/panels/map2/module.js b/panels/map2/module.js index dc7a48ff8f9..4048210c99b 100644 --- a/panels/map2/module.js +++ b/panels/map2/module.js @@ -1,5 +1,5 @@ angular.module('kibana.map2', []) - .controller('map2', function ($scope, eventBus) { + .controller('map2', function ($scope, eventBus, keylistener) { // Set and populate defaults var _d = { @@ -413,14 +413,16 @@ angular.module('kibana.map2', []) //@todo implement a global "keypress service", since this fails if there are >1 spheres if (scope.panel.display.data.type === 'orthographic') { - window.focus(); - d3.select(window) + //scope.svg.focus(); + /* + scope.svg.selectAll(".overlay") .on("keydown", function() { scope.ctrlKey = d3.event.ctrlKey; }) .on("keyup", function() { scope.ctrlKey = d3.event.ctrlKey; }); +*/ scope.svg.style("cursor", "move")