From dffc3541a4575d051dac04eda210273037f68e90 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 2 Jun 2017 11:51:17 -0400 Subject: [PATCH] Match '+' as-is (no shift, because shift '+' is '?' on some non-US keyboards) (closes #4079) --- modules/ui/zoom.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/ui/zoom.js b/modules/ui/zoom.js index 28e00d22b..db3657d18 100644 --- a/modules/ui/zoom.js +++ b/modules/ui/zoom.js @@ -71,10 +71,20 @@ export function uiZoom(context) { var keybinding = d3keybinding('zoom'); - _.each(['=','ffequals','plus','ffplus'], function(key) { + + // match '+' as-is (no '⇧', because '⇧+' is '?' on some non-US keyboards) + _.each(['plus','ffplus'], function(key) { + keybinding.on([key], zoomIn); + keybinding.on([uiCmd('⌘' + key)], zoomInFurther); + }); + + // also match '=' and '⇧=' as a plus + _.each(['=','ffequals'], function(key) { keybinding.on([key, '⇧' + key], zoomIn); keybinding.on([uiCmd('⌘' + key), uiCmd('⌘⇧' + key)], zoomInFurther); }); + + // match '-' and '⇧-' as a minus _.each(['-','ffminus','dash'], function(key) { keybinding.on([key, '⇧' + key], zoomOut); keybinding.on([uiCmd('⌘' + key), uiCmd('⌘⇧' + key)], zoomOutFurther);