From 8c2775276eaf0946686ad479543ea20343f413e3 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 9 Jun 2017 22:37:44 -0400 Subject: [PATCH] Fix fullscreen shortcut on Mac, add F11 to the shortcuts screen (see https://github.com/openstreetmap/iD/issues/4081#issuecomment-307475720) --- data/shortcuts.json | 4 ++-- modules/ui/cmd.js | 2 ++ modules/ui/full_screen.js | 3 +-- modules/ui/shortcuts.js | 7 +++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/data/shortcuts.json b/data/shortcuts.json index 8eda5ac79c..09cc9676d2 100644 --- a/data/shortcuts.json +++ b/data/shortcuts.json @@ -53,8 +53,8 @@ "shortcuts": ["F"], "text": "shortcuts.browsing.display_options.map_data" }, { - "modifiers": ["⌘", "⇧"], - "shortcuts": ["F"], + "modifiers": ["⌃", "⌘"], + "shortcuts": ["F", "F11"], "text": "shortcuts.browsing.display_options.fullscreen" }, { "shortcuts": ["W"], diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index 2360d2f76c..7c1d72ee25 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -12,6 +12,7 @@ export var uiCmd = function (code) { if (detected.os === 'win') { if (code === '⌘⇧Z') return 'Ctrl+Y'; + if (code === '⌃⌘F') return 'F11'; } var result = '', @@ -45,6 +46,7 @@ uiCmd.display = function(code) { '⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), '⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'), '⌥': mac ? '⌥ ' + t('shortcuts.key.option') : t('shortcuts.key.alt'), + '⌃': mac ? '⌃ ' + t('shortcuts.key.ctrl') : t('shortcuts.key.ctrl'), '⌫': mac ? '⌫ ' + t('shortcuts.key.delete') : t('shortcuts.key.backspace'), '⌦': mac ? '⌦ ' + t('shortcuts.key.del') : t('shortcuts.key.del'), '↖': mac ? '↖ ' + t('shortcuts.key.pgup') : t('shortcuts.key.pgup'), diff --git a/modules/ui/full_screen.js b/modules/ui/full_screen.js index be7cfb2f8b..90e7cb25a8 100644 --- a/modules/ui/full_screen.js +++ b/modules/ui/full_screen.js @@ -74,8 +74,7 @@ export function uiFullScreen(context) { // .attr('class', 'icon full-screen'); keybinding - .on('f11', fullScreen) - .on(uiCmd('⌘⇧F'), fullScreen); + .on([uiCmd('⌃⌘F'), 'f11'], fullScreen); d3.select(document) .call(keybinding); diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index 3e2d8ab86e..7a83c7db80 100644 --- a/modules/ui/shortcuts.js +++ b/modules/ui/shortcuts.js @@ -151,6 +151,8 @@ export function uiShortcuts() { .data(function (d) { if (detected.os === 'win' && d.text === 'shortcuts.editing.commands.redo') { return ['⌘']; + } else if (detected.os === 'win' && d.text === 'shortcuts.browsing.display_options.fullscreen') { + return []; } else { return d.modifiers; } @@ -178,6 +180,11 @@ export function uiShortcuts() { shortcut: 'Y', separator: d.separator }]; + } else if (detected.os === 'win' && d.text === 'shortcuts.browsing.display_options.fullscreen') { + return [{ + shortcut: 'F11', + separator: d.separator + }]; } return d.shortcuts.map(function(s) {