3

When processing a KeyDown event for the Delete key, the KeyCode shows up as

RButton | MButton | Back | Space

enter image description here

I can determine from the Keys enum that

RButton = 2
MButton = 4
Back = 8
Space = 32

Delete = 46

and

2 + 4 + 8 + 32 = 46

But why is this?

Rachel
  • 130,264
  • 66
  • 304
  • 490
  • 1
    Because it's a `[Flags]` enum. – SLaks Feb 04 '14 at 18:08
  • @SLaks That makes sense. This seems like a very strange way to show the `KeyCode` in the debugger though, as most people probably don't realize that, or have the `Keys` enum memorized – Rachel Feb 04 '14 at 18:13

0 Answers0