mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 12:26:34 +00:00
Fix keybindings to switch between tabs on MacOs (#1686)
This commit is contained in:
parent
8778d70ad7
commit
3ad660927f
@ -6,6 +6,8 @@ import {
|
|||||||
} from '@theia/core/lib/browser/common-frontend-contribution';
|
} from '@theia/core/lib/browser/common-frontend-contribution';
|
||||||
import { CommandRegistry } from '@theia/core/lib/common/command';
|
import { CommandRegistry } from '@theia/core/lib/common/command';
|
||||||
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
|
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
|
||||||
|
import { KeybindingRegistry } from '@theia/core/lib/browser';
|
||||||
|
import { isOSX } from '@theia/core';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
|
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 {
|
override onWillStop(): OnWillStopAction | undefined {
|
||||||
// This is NOOP here. All window close and app quit requests are handled in the `Close` contribution.
|
// This is NOOP here. All window close and app quit requests are handled in the `Close` contribution.
|
||||||
return undefined;
|
return undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user