diff --git a/arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts b/arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts index 0785cad03..98d6d49e6 100644 --- a/arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts +++ b/arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts @@ -6,6 +6,8 @@ import { } from '@theia/core/lib/browser/common-frontend-contribution'; import { CommandRegistry } from '@theia/core/lib/common/command'; import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application'; +import { KeybindingRegistry } from '@theia/core/lib/browser'; +import { isOSX } from '@theia/core'; @injectable() export class CommonFrontendContribution extends TheiaCommonFrontendContribution { @@ -50,6 +52,36 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution } } + override registerKeybindings(registry: KeybindingRegistry): void { + super.registerKeybindings(registry); + // Workaround for https://github.com/eclipse-theia/theia/issues/11875 + if (isOSX) { + registry.unregisterKeybinding('ctrlcmd+tab'); + registry.unregisterKeybinding('ctrlcmd+alt+d'); + registry.unregisterKeybinding('ctrlcmd+shift+tab'); + registry.unregisterKeybinding('ctrlcmd+alt+a'); + + registry.registerKeybindings( + { + command: CommonCommands.NEXT_TAB.id, + keybinding: 'ctrl+tab', + }, + { + command: CommonCommands.NEXT_TAB.id, + keybinding: 'ctrl+alt+d', + }, + { + command: CommonCommands.PREVIOUS_TAB.id, + keybinding: 'ctrl+shift+tab', + }, + { + command: CommonCommands.PREVIOUS_TAB.id, + keybinding: 'ctrl+alt+a', + } + ); + } + } + override onWillStop(): OnWillStopAction | undefined { // This is NOOP here. All window close and app quit requests are handled in the `Close` contribution. return undefined;