小さなテストプログラムを作成して、Key
が何であるかを調べました。新しいWPFプロジェクトを作成し、メインウィンドウCS-ファイルに追加します。
public MainWindow()
{
InitializeComponent();
var skip = new[] { Key.None, Key.DeadCharProcessed };
foreach (Key value in Enum.GetValues(typeof(Key)))
if (!skip.Contains(value))
InputBindings.Add(new KeyBinding { Command = new MyCommand(value.ToString()), Key = value });
}
public class MyCommand : ICommand
{
public event EventHandler CanExecuteChanged;
public string Text { get; }
public MyCommand(string text) { Text = text; }
public bool CanExecute(object parameter) => true;
public void Execute(object parameter) => MessageBox.Show(Text);
}
あなたの時間を節約するために:
Ü = Key.Oem1
Ö = Key.Oem3
Ä = Key.OemQuotes
この質問https://stackoverflow.com/questions/582403/what-are-the -emem-keys-in-the-system-windows-forms-keys-enumerationは、これらがキーボード製造元によって変更される可能性があることを示唆しているため、OPは別の解決策を見つけなければならない可能性があります... – Will
@Will、 、ありがとう。私の解決策に従うためには、自分のソフトウェアのキーを再定義する仕組みを提供する必要があります。 – Sinatr
@Sinatr:どうもありがとう。今私は理解し、それを機能させることができます。 –