Difference between Keys.Shift and Keys.ShiftKey

Brian Tacker picture Brian Tacker · Jun 22, 2011 · Viewed 7.2k times · Source

In my application i detect when a key is pressed and see if the modifier is the shift key but the Keys enumerator has Shift and ShiftKey.

It seems the event is always sending Keys.Shift, but is there a case where the Keys.ShiftKey will be used?

(and the same question applies to Keys.Control and Keys.ControlKey)

Thanks for any input.

Answer

Bala R picture Bala R · Jun 22, 2011

Keys.Shift is a modifier key (used for key combinations) while Keys.ShiftKey is a regular key code just like most others in the Keys enumeration.