From ed5c6354e2614eef3fa5063c165df44f417e93c4 Mon Sep 17 00:00:00 2001 From: drewprice Date: Wed, 21 Jun 2017 14:20:56 -0400 Subject: [PATCH] Include legacy scroll shortcut for mac --- keymaps/learn-ide.json | 4 +++- lib/terminal-view.js | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/keymaps/learn-ide.json b/keymaps/learn-ide.json index 8bcfd53..90f43d3 100644 --- a/keymaps/learn-ide.json +++ b/keymaps/learn-ide.json @@ -14,7 +14,9 @@ "cmd--": "learn-ide:decrease-font-size", "cmd-0": "learn-ide:reset-font-size", "cmd-up": "learn-ide:scroll-up", - "cmd-down": "learn-ide:scroll-down" + "cmd-down": "learn-ide:scroll-down", + "ctrl-alt-up": "learn-ide:scroll-up", + "ctrl-alt-down": "learn-ide:scroll-down" }, ".platform-win32 .terminal, .platform-linux .terminal": { "ctrl-=": "learn-ide:increase-font-size", diff --git a/lib/terminal-view.js b/lib/terminal-view.js index d68181b..1f62c83 100644 --- a/lib/terminal-view.js +++ b/lib/terminal-view.js @@ -88,13 +88,16 @@ class TerminalView extends View { return ctrlKey && (keyCode === 83) && (process.platform !== 'darwin') } - isAttemptToScroll({keyCode, ctrlKey, metaKey}) { + isAttemptToScroll({keyCode, ctrlKey, metaKey, altKey}) { var isUpOrDown = [38, 40].includes(keyCode); if (!isUpOrDown) { return false } - // cmd-up/down on mac, or ctrl-up/down on windows and linux - return process.platform === 'darwin' ? metaKey : ctrlKey + // ctrl-up/down on windows and linux + if (process.platform !== 'darwin') { return ctrlKey } + + // cmd-up/down or ctrl-alt-up/down on mac + return metaKey || (ctrlKey && altKey) } loadPopoutEmulator() {