0

I have a KeyEvent called Bind that captures two key presses (Ctrl + Ins) I want to return this as a string but when I do using (Bind.KeyData.ToString()) the string is backwards and instead of ( Control, Insert ) it returns ( Insert, Control ). How do I fix this?

private KeyEventArgs Bind = new KeyEventArgs(Keys.Control | Keys.Insert);

And to call I use

Bind.KeyData.ToString()
  • Nobody can tell that you are asking a [winforms] question. Consider `new KeysConverter().ConvertToString(Bind.KeyData)` to generate the kind of string that is used in menus. – Hans Passant May 24 '18 at 14:06

1 Answers1

0

Construct you result string manually:

string result = $"{Bind.Modifiers}, {Bind.KeyCode}";
SᴇM
  • 7,024
  • 3
  • 24
  • 41