From 309518cf9a86f5380f547535610b40aedf7a9059 Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Tue, 13 Feb 2024 11:18:38 +0100 Subject: [PATCH 1/3] Navigation on Mac with Command instead of Option --- app/browser/tools/shortcuts.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/browser/tools/shortcuts.js b/app/browser/tools/shortcuts.js index 9e6e6edf..116c48e9 100644 --- a/app/browser/tools/shortcuts.js +++ b/app/browser/tools/shortcuts.js @@ -25,14 +25,17 @@ class Shortcuts { } } +const isMac = os.platform() === 'darwin'; +const navigationModifiedKey = isMac ? 'META' : 'ALT'; + const KEY_MAPS = { 'CTRL_+': () => zoom.increaseZoomLevel(), 'CTRL_=': () => zoom.increaseZoomLevel(), 'CTRL_-': () => zoom.decreaseZoomLevel(), 'CTRL__': () => zoom.decreaseZoomLevel(), 'CTRL_0': () => zoom.resetZoomLevel(), - 'ALT_ArrowLeft': () => window.history.back(), - 'ALT_ArrowRight': () => window.history.forward() + [`${navigationModifiedKey}_ArrowLeft`]: () => window.history.back(), + [`${navigationModifiedKey}_ArrowRight`]: () => window.history.forward() }; function initInternal() { @@ -70,7 +73,7 @@ function whenIframeReady(callback) { function keyDownEventHandler(event) { const keyName = event.key; - if (keyName === 'Control' || keyName === 'Alt') { + if (keyName === 'Control' || keyName === 'Alt' || keyName === 'Meta') { return; } @@ -89,7 +92,7 @@ function wheelEventHandler(event) { } function getKeyName(event, keyName) { - return `${event.ctrlKey ? 'CTRL_' : ''}${event.altKey ? 'ALT_' : ''}${keyName}`; + return `${event.ctrlKey ? 'CTRL_' : ''}${event.altKey ? 'ALT_' : ''}${event.metaKey ? 'META_': ''}${keyName}`; } function fireEvent(event, keyName) { From efeef6cc0a191b3751d9e177a575536fa5ffc834 Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Tue, 13 Feb 2024 12:04:25 +0100 Subject: [PATCH 2/3] Disable keyboard naviation for Mac completely The previous attempt to use Command (Meta) + Left / Right did not work. --- app/browser/tools/shortcuts.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/browser/tools/shortcuts.js b/app/browser/tools/shortcuts.js index 116c48e9..fc8c4705 100644 --- a/app/browser/tools/shortcuts.js +++ b/app/browser/tools/shortcuts.js @@ -26,7 +26,6 @@ class Shortcuts { } const isMac = os.platform() === 'darwin'; -const navigationModifiedKey = isMac ? 'META' : 'ALT'; const KEY_MAPS = { 'CTRL_+': () => zoom.increaseZoomLevel(), @@ -34,8 +33,14 @@ const KEY_MAPS = { 'CTRL_-': () => zoom.decreaseZoomLevel(), 'CTRL__': () => zoom.decreaseZoomLevel(), 'CTRL_0': () => zoom.resetZoomLevel(), - [`${navigationModifiedKey}_ArrowLeft`]: () => window.history.back(), - [`${navigationModifiedKey}_ArrowRight`]: () => window.history.forward() + // Alt (Option) Left / Right is used to jump words in Mac, so diabling the history navigation for Mac here + ...(!isMac ? + { + 'ALT_ArrowLeft': () => window.history.back(), + 'ALT_ArrowRight': () => window.history.forward() + } + : {} + ) }; function initInternal() { @@ -73,7 +78,7 @@ function whenIframeReady(callback) { function keyDownEventHandler(event) { const keyName = event.key; - if (keyName === 'Control' || keyName === 'Alt' || keyName === 'Meta') { + if (keyName === 'Control' || keyName === 'Alt') { return; } @@ -92,7 +97,7 @@ function wheelEventHandler(event) { } function getKeyName(event, keyName) { - return `${event.ctrlKey ? 'CTRL_' : ''}${event.altKey ? 'ALT_' : ''}${event.metaKey ? 'META_': ''}${keyName}`; + return `${event.ctrlKey ? 'CTRL_' : ''}${event.altKey ? 'ALT_' : ''}${keyName}`; } function fireEvent(event, keyName) { From d6458c0f8e0cdea01f83568ccb4efc65d4c7af8e Mon Sep 17 00:00:00 2001 From: Jan Stastny Date: Wed, 14 Feb 2024 08:21:33 +0100 Subject: [PATCH 3/3] Bump version and add changelog --- com.github.IsmaelMartinez.teams_for_linux.appdata.xml | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/com.github.IsmaelMartinez.teams_for_linux.appdata.xml b/com.github.IsmaelMartinez.teams_for_linux.appdata.xml index 4dcf054b..879c7dc0 100644 --- a/com.github.IsmaelMartinez.teams_for_linux.appdata.xml +++ b/com.github.IsmaelMartinez.teams_for_linux.appdata.xml @@ -14,6 +14,13 @@ https://github.com/IsmaelMartinez/teams-for-linux/issues com.github.IsmaelMartinez.teams_for_linux.desktop + + +
    +
  • Fix: MacOS - Disable Option + Left / Right keyboard shortcuts for history navigation (it is used for word jumping on MacOS)
  • +
+
+
    diff --git a/package.json b/package.json index c68b9923..5863bf61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "1.4.10", + "version": "1.4.11", "main": "app/index.js", "description": "Unofficial client for Microsoft Teams for Linux", "homepage": "https://github.com/IsmaelMartinez/teams-for-linux",