Files
PowerToys/src/settings-ui/Settings.UI.Library/AppSpecificKeysDataModel.cs
Andrey Nekrasov f742d3c1c3 [KBM]Allow remapping keys and shortcuts to arbitrary unicode sequences (#29399)
* [KBM] Allow remapping keys and shortcuts to arbitrary unicode sequences

* f: spelling

* f: tests

* f: split shortcut configuration

* f: address ui layout comments

* [BugReport]Don't report personal info

* f: fix crash in KBME

* f: add missed type button

* f: fix shortcut line UI elements alignment

* f: align elements size

* f: add warning about non-mapped keys
2023-11-23 10:46:07 +00:00

38 lines
1.3 KiB
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public class AppSpecificKeysDataModel : KeysDataModel
{
[JsonPropertyName("targetApp")]
public string TargetApp { get; set; }
public new List<string> GetMappedOriginalKeys()
{
return base.GetMappedOriginalKeys();
}
public new List<string> GetMappedNewRemapKeys()
{
return base.GetMappedNewRemapKeys();
}
public bool Compare(AppSpecificKeysDataModel arg)
{
ArgumentNullException.ThrowIfNull(arg);
// Using Ordinal comparison for internal text
return string.Equals(OriginalKeys, arg.OriginalKeys, StringComparison.Ordinal) &&
string.Equals(NewRemapKeys, arg.NewRemapKeys, StringComparison.Ordinal) &&
string.Equals(NewRemapString, arg.NewRemapString, StringComparison.Ordinal) &&
string.Equals(TargetApp, arg.TargetApp, StringComparison.Ordinal);
}
}
}