Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net KeyEventArgs return vs enter

Tags:

c#

.net

keyboard

Have this in a c# .net application:

string key = e.KeyCode.ToString();

in .net 1.1 key = "enter"

in .net 3.5 key = "return"

my question is why are they different?

like image 228
dnndeveloper Avatar asked Oct 13 '09 01:10

dnndeveloper


1 Answers

Here are all of the duplicate names: This was generated by the following query in LINQPad:

Enum.GetNames(typeof(Keys))
    .GroupBy(k => Enum.Parse(typeof(Keys), k))
    .Where(g => g.Count() > 1)
    .Select(g => String.Join(", ", g.Select(k => k.ToString()).ToArray()))

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
like image 162
SLaks Avatar answered Oct 14 '22 08:10

SLaks