terminal/src/cascadia/TerminalSettingsModel/ActionArgs.idl
Mike Griese 3866771b1b
Add "monitor": "any"|"toCurrent"|"toMouse" setting to globalSummon (#10092)
#### ⚠️ this pr targets #9977

## Summary of the Pull Request

This adds support for part of the `monitor` property for `globalSummon`. It also goes a little off-spec:

```json
"monitor": "any"|"toCurrent"|"toMouse"
```

* `monitor`: This controls the monitor that the window will be summoned from/to
  - `"any"`: Summon the MRU window, regardless of which monitor it's currently on.
  - `"toCurrent"`/omitted: (_default_): Summon the MRU window **TO** the monitor with the current **foreground** window.
  - [**NEW**] `"toMouse"`: Summon the MRU window **TO** the monitor where the **mouse** cursor is.

When I was playing with this, It felt like `toMouse` was always what I wanted, not `toCurrent`. We can always just comment that out if we think that's contentious - I'm aware I didn't originally spec that.

## References
* Original thread: #653
* Spec: #9274 
* megathread: #8888

## PR Checklist
* [x] Closes https://github.com/microsoft/terminal/projects/5#card-60325291
* [x] I work here
* [ ] Tests added/passed
* [ ] Requires documentation to be updated 😢 

## Detailed Description of the Pull Request / Additional comments

I made `toMouse` the default because it felt better. fite-me.jpg 

## Validation Steps Performed
my ever evolving blob:

```jsonc
    { "keys": "ctrl+`", "command": { "action": "quakeMode" } },
    { "keys": "ctrl+1", "command": { "action": "globalSummon" } },
    // { "keys": "ctrl+2", "command": { "action": "globalSummon", "desktop": "toCurrent" } },
    // { "keys": "ctrl+2", "command": { "action": "globalSummon", "toggleVisibility": false } },
    // { "keys": "ctrl+2", "command": { "action": "globalSummon", "dropdownDuration": 2000 } },
    { "keys": "ctrl+2", "command": { "action": "globalSummon", "monitor": "any" } },
    // { "keys": "ctrl+3", "command": { "action": "globalSummon", "desktop": "onCurrent" } },
    { "keys": "ctrl+3", "command": { "action": "globalSummon", "monitor": "toMouse" } },
    // { "keys": "ctrl+4", "command": { "action": "globalSummon", "desktop": "any" } },
    { "keys": "ctrl+4", "command": { "action": "globalSummon", "monitor": "toMouse", "dropdownDuration": 500 } },
    { "keys": "ctrl+5", "command": { "action": "globalSummon", "dropdownDuration": 500 } },
```
2021-05-17 12:57:08 +00:00

281 lines
7 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace Microsoft.Terminal.Settings.Model
{
interface IActionArgs
{
Boolean Equals(IActionArgs other);
String GenerateName();
IActionArgs Copy();
UInt64 Hash();
};
interface IActionEventArgs
{
Boolean Handled;
IActionArgs ActionArgs { get; };
};
enum ResizeDirection
{
None = 0,
Left,
Right,
Up,
Down
};
enum FocusDirection
{
None = 0,
Left,
Right,
Up,
Down,
Previous
};
enum SplitState
{
Automatic = -1,
None = 0,
Vertical = 1,
Horizontal = 2
};
enum SplitType
{
Manual = 0,
Duplicate = 1
};
enum SettingsTarget
{
SettingsFile = 0,
DefaultsFile,
AllFiles,
SettingsUI
};
enum MoveTabDirection
{
None = 0,
Forward,
Backward
};
enum FindMatchDirection
{
None = 0,
Next,
Previous
};
enum CommandPaletteLaunchMode
{
Action = 0,
CommandLine
};
enum TabSwitcherMode
{
MostRecentlyUsed,
InOrder,
Disabled,
};
enum DesktopBehavior
{
Any,
ToCurrent,
OnCurrent,
};
enum MonitorBehavior
{
Any,
ToCurrent,
ToMouse,
};
[default_interface] runtimeclass NewTerminalArgs {
NewTerminalArgs();
NewTerminalArgs(Int32 profileIndex);
NewTerminalArgs Copy();
String Commandline;
String StartingDirectory;
String TabTitle;
Windows.Foundation.IReference<Windows.UI.Color> TabColor;
String Profile; // Either a GUID or a profile's name if the GUID isn't a match
// ProfileIndex can be null (for "use the default"), so this needs to be
// a IReference, so it's nullable
Windows.Foundation.IReference<Int32> ProfileIndex { get; };
Windows.Foundation.IReference<Boolean> SuppressApplicationTitle;
String ColorScheme;
Boolean Equals(NewTerminalArgs other);
String GenerateName();
String ToCommandline();
UInt64 Hash();
};
[default_interface] runtimeclass ActionEventArgs : IActionEventArgs
{
ActionEventArgs();
ActionEventArgs(IActionArgs args);
};
[default_interface] runtimeclass CopyTextArgs : IActionArgs
{
Boolean SingleLine { get; };
Windows.Foundation.IReference<Microsoft.Terminal.Control.CopyFormat> CopyFormatting { get; };
};
[default_interface] runtimeclass NewTabArgs : IActionArgs
{
NewTabArgs(NewTerminalArgs terminalArgs);
NewTerminalArgs TerminalArgs { get; };
};
[default_interface] runtimeclass SwitchToTabArgs : IActionArgs
{
SwitchToTabArgs(UInt32 tabIndex);
UInt32 TabIndex;
};
[default_interface] runtimeclass ResizePaneArgs : IActionArgs
{
ResizeDirection ResizeDirection { get; };
};
[default_interface] runtimeclass MoveFocusArgs : IActionArgs
{
MoveFocusArgs(FocusDirection direction);
FocusDirection FocusDirection { get; };
};
[default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs
{
Int32 Delta { get; };
};
[default_interface] runtimeclass SendInputArgs : IActionArgs
{
String Input { get; };
};
[default_interface] runtimeclass SplitPaneArgs : IActionArgs
{
SplitPaneArgs(SplitType splitMode, SplitState split, Double size, NewTerminalArgs terminalArgs);
SplitPaneArgs(SplitState split, Double size, NewTerminalArgs terminalArgs);
SplitPaneArgs(SplitState split, NewTerminalArgs terminalArgs);
SplitPaneArgs(SplitType splitMode);
SplitState SplitStyle { get; };
NewTerminalArgs TerminalArgs { get; };
SplitType SplitMode { get; };
Double SplitSize { get; };
};
[default_interface] runtimeclass OpenSettingsArgs : IActionArgs
{
OpenSettingsArgs(SettingsTarget target);
SettingsTarget Target { get; };
};
[default_interface] runtimeclass SetColorSchemeArgs : IActionArgs
{
SetColorSchemeArgs(String name);
String SchemeName { get; };
};
[default_interface] runtimeclass SetTabColorArgs : IActionArgs
{
Windows.Foundation.IReference<Windows.UI.Color> TabColor { get; };
};
[default_interface] runtimeclass RenameTabArgs : IActionArgs
{
String Title { get; };
};
[default_interface] runtimeclass ExecuteCommandlineArgs : IActionArgs
{
ExecuteCommandlineArgs(String commandline);
String Commandline;
};
[default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs
{
CloseOtherTabsArgs(UInt32 tabIndex);
Windows.Foundation.IReference<UInt32> Index { get; };
};
[default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs
{
CloseTabsAfterArgs(UInt32 tabIndex);
Windows.Foundation.IReference<UInt32> Index { get; };
};
[default_interface] runtimeclass MoveTabArgs : IActionArgs
{
MoveTabArgs(MoveTabDirection direction);
MoveTabDirection Direction { get; };
};
[default_interface] runtimeclass ScrollUpArgs : IActionArgs
{
Windows.Foundation.IReference<UInt32> RowsToScroll { get; };
};
[default_interface] runtimeclass ScrollDownArgs : IActionArgs
{
Windows.Foundation.IReference<UInt32> RowsToScroll { get; };
};
[default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs
{
CommandPaletteLaunchMode LaunchMode { get; };
};
[default_interface] runtimeclass FindMatchArgs : IActionArgs
{
FindMatchArgs(FindMatchDirection direction);
FindMatchDirection Direction { get; };
};
[default_interface] runtimeclass NewWindowArgs : IActionArgs
{
NewWindowArgs(NewTerminalArgs terminalArgs);
NewTerminalArgs TerminalArgs { get; };
};
[default_interface] runtimeclass PrevTabArgs : IActionArgs
{
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
};
[default_interface] runtimeclass NextTabArgs : IActionArgs
{
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
};
[default_interface] runtimeclass RenameWindowArgs : IActionArgs
{
String Name { get; };
};
[default_interface] runtimeclass GlobalSummonArgs : IActionArgs
{
String Name { get; };
DesktopBehavior Desktop { get; };
MonitorBehavior Monitor { get; };
Boolean ToggleVisibility { get; };
UInt32 DropdownDuration { get; };
};
}