`KeyMapping` was introduced to break up `AppKeyBindings`. `KeyMapping` records the keybindings from the JSON and lets you query them. `AppKeyBindings` now just holds a `ShortcutActionDispatcher` to run actions, and a `KeyMapping` to record/query your existing keybindings. This refactor allows `KeyMapping` to be moved to the TerminalSettingsModel, and `ShortcutActionDispatcher` and `AppKeyBindings` will stay in TerminalApp. `AppKeyBindings` had to be passed down to a terminal via `TerminalSettings`. Since each settings object had its own responsibility to update/create a `TerminalSettings` object, I moved all of that logic to `TerminalSettings`. This helps with the TerminalSettingsModel refactor, and makes the construction of `TerminalSettings` a bit cleaner and more centralized. ## References #885 - this is all in preparation for the TerminalSettingsModel ## Validation Steps Performed - [x] Tests passed - [X] Deployment succeeded
52 lines
4.3 KiB
Plaintext
52 lines
4.3 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
import "KeyMapping.idl";
|
|
|
|
namespace TerminalApp
|
|
{
|
|
[default_interface] runtimeclass ShortcutActionDispatch {
|
|
ShortcutActionDispatch();
|
|
|
|
Boolean DoAction(ActionAndArgs actionAndArgs);
|
|
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CopyText;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> PasteText;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NewTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> OpenNewTabDropdown;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> DuplicateTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NewWindow;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseWindow;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ClosePane;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SwitchToTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> NextTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> PrevTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SendInput;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SplitPane;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> TogglePaneZoom;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> AdjustFontSize;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ResetFontSize;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollUp;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollDown;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollUpPage;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ScrollDownPage;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> OpenSettings;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ResizePane;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> Find;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> MoveFocus;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleRetroEffect;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleFocusMode;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleFullscreen;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleAlwaysOnTop;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ToggleCommandPalette;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SetColorScheme;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> SetTabColor;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> OpenTabColorPicker;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> RenameTab;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> ExecuteCommandline;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseOtherTabs;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> CloseTabsAfter;
|
|
event Windows.Foundation.TypedEventHandler<ShortcutActionDispatch, ActionEventArgs> TabSearch;
|
|
}
|
|
}
|