Keyboard event issue
- by Petar Minchev
Hello guys!
I have to capture the following keyboard event in a TextBox - SHIFT + 8(on the numpad). This also means the NumLock will be on. When I try the following, nothing is printed:
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Shift && e.KeyCode == Keys.NumPad8)
Console.WriteLine("SHIFT + UP");
}
But CTRL + 8(on the numpad) is working.
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.NumPad8)
Console.WriteLine("CTRL + UP");
}
Could someone explain me, why SHIFT + 8 isn't fired, but CTRL + 8 is working?
P.S. I wrote + UP, because the user wants to navigate with the numpad arrows and the SHIFT key, but his NumLock will also be on. That's why I catch Keys.NumPad8.
All the best,
Petar