Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Keys.Shift and Keys.ShiftKey

Tags:

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.

like image 889
Brian Tacker Avatar asked Jun 22 '11 21:06

Brian Tacker


People also ask

Why is the shift key called Shift?

The Shift key's name originated from the typewriter, where one had to press and hold the button to shift up the case stamp to change to capital letters; the shift key was first used in the Remington No. 2 Type-Writer of 1878; the No. 1 model was capital-only.

Why are there two shift keys on the keyboard?

The reason there are two Shift keys on a computer keyboard is to make it easier to use the Shift function with all keyboard keys. For example, it's easier to use the left Shift key with all the keys on the right side of the keyboard.

What is the shift key on a keyboard?

Pressing the 'shift' key allows you to type capital letters and the symbols at the top of the keys. The 'shift' keys are on the left and right of the keyboard, with the arrow pointing upwards. For capital letters, hold down the 'shift' key and hold and type the letter.


1 Answers

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.

like image 152
Bala R Avatar answered Sep 19 '22 09:09

Bala R