Skip to content

Commit 3ad6609

Browse files
author
Alberto Iannaccone
authored
Fix keybindings to switch between tabs on MacOs (#1686)
1 parent 8778d70 commit 3ad6609

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts

+32
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
} from '@theia/core/lib/browser/common-frontend-contribution';
77
import { CommandRegistry } from '@theia/core/lib/common/command';
88
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
9+
import { KeybindingRegistry } from '@theia/core/lib/browser';
10+
import { isOSX } from '@theia/core';
911

1012
@injectable()
1113
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
@@ -50,6 +52,36 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
5052
}
5153
}
5254

55+
override registerKeybindings(registry: KeybindingRegistry): void {
56+
super.registerKeybindings(registry);
57+
// Workaround for https://github.com/eclipse-theia/theia/issues/11875
58+
if (isOSX) {
59+
registry.unregisterKeybinding('ctrlcmd+tab');
60+
registry.unregisterKeybinding('ctrlcmd+alt+d');
61+
registry.unregisterKeybinding('ctrlcmd+shift+tab');
62+
registry.unregisterKeybinding('ctrlcmd+alt+a');
63+
64+
registry.registerKeybindings(
65+
{
66+
command: CommonCommands.NEXT_TAB.id,
67+
keybinding: 'ctrl+tab',
68+
},
69+
{
70+
command: CommonCommands.NEXT_TAB.id,
71+
keybinding: 'ctrl+alt+d',
72+
},
73+
{
74+
command: CommonCommands.PREVIOUS_TAB.id,
75+
keybinding: 'ctrl+shift+tab',
76+
},
77+
{
78+
command: CommonCommands.PREVIOUS_TAB.id,
79+
keybinding: 'ctrl+alt+a',
80+
}
81+
);
82+
}
83+
}
84+
5385
override onWillStop(): OnWillStopAction | undefined {
5486
// This is NOOP here. All window close and app quit requests are handled in the `Close` contribution.
5587
return undefined;

0 commit comments

Comments
 (0)