Though the Keys enum has identical values for Enter and Return (it also has a number of other duplicates), ToString shows a different value.
If you run this linq expression in linqpad, you'll see what I mean.
Enum.GetNames(typeof(System.Windows.Forms.Keys)) .GroupBy(k
=> Enum.Parse(typeof(System.Windows.Forms.Keys), k
)) .Where(g => g.Count() > 1)
.Select(g => String.Join(", ", g.Select(k => k.ToString()).ToArray())).Dump();
Check for the tostring if you really need to know the difference.
-wraith808
Hello wraith808,
I did not understand all of it but,
Tried it in C# as follows
foreach (var VARIABLE in Enum.GetNames(typeof (System.Windows.Forms.Keys))
.GroupBy(k => Enum.Parse(typeof (System.Windows.Forms.Keys), k))
.Where(g => g.Count() > 1)
.Select(g => String.Join(", ", g.Select(k => k.ToString()).ToArray())))
{
richTextBox1.AppendText(VARIABLE+"\r\n");
}
Got following...
Enter, Return
CapsLock, Capital
HangulMode, HanguelMode, KanaMode
KanjiMode, HanjaMode
IMEAccept, IMEAceept
Prior, PageUp
PageDown, Next
Snapshot, PrintScreen
OemSemicolon, Oem1
Oem2, OemQuestion
Oem3, Oemtilde
Oem4, OemOpenBrackets
OemPipe, Oem5
OemCloseBrackets, Oem6
OemQuotes, Oem7
Oem102, OemBackslash
that is Enter and Return does have same value,
Thanks for your time and code, I might have missed your point if you are telling something more than I've understood,
but is there any difference between Main Enter Key and Enter Key on Numpad!?
Firdaus Shaikh
('',)