This is because you are mixing Virtual Key Codes with ascii values. The ascii value of 'k' is 107 which is also the virtual key code VK_ADD.
If testing for alphabetic keys in your code, use the uppercase or the virtual key code (VK_K), not the lower case and then use TShiftState to determine if it is upper or lower case.
Code:
if (Key == 'K' && !Shift.Contains(ssShift))
{
// do something
}
The ascii key value only matches the virtual key code for uppercase alphabetic keys and the numeric keys (not the numeric keys on the keypad). Of course with the numeric keys, you would also have to check the shift state to determine if it is say the '8' or the '*'.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.