2
Answers

Finding Keycodes

Kasun Lee

Kasun Lee

7y
179
1
Hi
 
Like the code for  Left control key is "LControlKey", what's the code for "@" sign? Is there a place to find this information online? And what's actually call these codes? Not keycodes, they are numbers, right?
 
Thanks!
Answers (2)
2
Amit Gupta

Amit Gupta

NA 16.5k 25.7k 7y
There is nothing like @ keycode directly. This is invoked when shift key is pressed. You can detect the keycode of D2 with shift modifiers
 
  1. private void yourControl_KeyDown(object sender, KeyEventArgs e)  
  2. {  
  3.    if((e.KeyCode == Keys.D2) && e.Shift)  
  4.    {  
  5.       // User pressed '@' ...  
  6.    }  
  7. }  
 
Accepted
0
Midhun T P

Midhun T P

NA 19.7k 281.1k 7y
Hi,
 
Please check below articles -
 
https://msdn.microsoft.com/en-us/library/system.windows.forms.keys(v=vs.110).aspx
 
https://msdn.microsoft.com/en-us/library/windows/desktop/ee525958.aspx