implement keyboard shortcuts using KeyboardEvent.key api

this should improve compatibility across keyboard layouts (e.g. different languages). Old-style keycodes are still used for browsers that don't implement the new key property.
This commit is contained in:
Martin Raifer
2016-11-08 16:09:04 +01:00
parent 7d14d2b0b0
commit 5dcedd9fc1
2 changed files with 135 additions and 11 deletions
+1 -1
View File
@@ -325,7 +325,7 @@ export function uiMapInMap(context) {
redraw();
var keybinding = d3keybinding('map-in-map')
.on(key, toggle);
.on([key, '⇧'+key], toggle);
d3.select(document)
.call(keybinding);