terminal/src/cascadia/TerminalApp/AppKeyBindings.idl
Mike Griese 8a69be0cc7
Switch to jsoncpp as our json library (#1005)
Switch to using jsoncpp as our json library. This lets us pretty-print the json file by default, and lets users place comments in the json file.

We will now only re-write the file when the actual logical structure of the json object changes, not only when the serialization changes.

Unfortunately, this will remove any existing ordering of profiles, and make the order random. We don't terribly care though, because when #754 lands, this will be less painful.

It also introduces a top-level globals object to hold all the global properties, including keybindings. Existing profiles should gracefully upgrade.
2019-06-04 16:55:27 -05:00

88 lines
2.7 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
{
enum ShortcutAction
{
CopyText = 0,
PasteText,
NewTab,
NewTabProfile0,
NewTabProfile1,
NewTabProfile2,
NewTabProfile3,
NewTabProfile4,
NewTabProfile5,
NewTabProfile6,
NewTabProfile7,
NewTabProfile8,
NewWindow,
CloseWindow,
CloseTab,
NextTab,
PrevTab,
SwitchToTab0,
SwitchToTab1,
SwitchToTab2,
SwitchToTab3,
SwitchToTab4,
SwitchToTab5,
SwitchToTab6,
SwitchToTab7,
SwitchToTab8,
IncreaseFontSize,
DecreaseFontSize,
ScrollUp,
ScrollDown,
ScrollUpPage,
ScrollDownPage,
OpenSettings
};
delegate void CopyTextEventArgs();
delegate void PasteTextEventArgs();
delegate void NewTabEventArgs();
delegate void NewTabWithProfileEventArgs(Int32 profileIndex);
delegate void NewWindowEventArgs();
delegate void CloseWindowEventArgs();
delegate void CloseTabEventArgs();
delegate void NextTabEventArgs();
delegate void PrevTabEventArgs();
delegate void SwitchToTabEventArgs(Int32 profileIndex);
delegate void IncreaseFontSizeEventArgs();
delegate void DecreaseFontSizeEventArgs();
delegate void ScrollUpEventArgs();
delegate void ScrollDownEventArgs();
delegate void ScrollUpPageEventArgs();
delegate void ScrollDownPageEventArgs();
delegate void OpenSettingsEventArgs();
[default_interface]
runtimeclass AppKeyBindings : Microsoft.Terminal.Settings.IKeyBindings
{
AppKeyBindings();
void SetKeyBinding(ShortcutAction action, Microsoft.Terminal.Settings.KeyChord chord);
Microsoft.Terminal.Settings.KeyChord GetKeyBinding(ShortcutAction action);
event CopyTextEventArgs CopyText;
event PasteTextEventArgs PasteText;
event NewTabEventArgs NewTab;
event NewTabWithProfileEventArgs NewTabWithProfile;
event NewWindowEventArgs NewWindow;
event CloseWindowEventArgs CloseWindow;
event CloseTabEventArgs CloseTab;
event SwitchToTabEventArgs SwitchToTab;
event NextTabEventArgs NextTab;
event PrevTabEventArgs PrevTab;
event IncreaseFontSizeEventArgs IncreaseFontSize;
event DecreaseFontSizeEventArgs DecreaseFontSize;
event ScrollUpEventArgs ScrollUp;
event ScrollDownEventArgs ScrollDown;
event ScrollUpPageEventArgs ScrollUpPage;
event ScrollDownPageEventArgs ScrollDownPage;
event OpenSettingsEventArgs OpenSettings;
}
}