So I want to be able to add all Keys to an Array of Keys, so that I can easily iterate over them and manipulate them.
So I would want something like this:
A bit of pseudo code.
Keys[] keys = ..All the keys..;
for(int i = 0; i<keys.Length; i++) {
//do something with the key here.
}
Basically what I want is to add all Keys from the Object ‘Keys’ (It’s a default Object, not my own) into an array of Keys[] so that I can iterate through those keys one by one.
If you mean that you want to turn the enumeration
System.Windows.Input.Keyinto an array, then you can do this:and of course you could obtain an
IEnumerable<Key>asIf you mean that you want to turn the enumeration
System.Windows.Forms.Keysinto an array then the same code applies