I have my code below, which displays the key code of a depressed key.
However, when I press the Ctrl key, the Alt key, the Cmd key, or the Shift key, nothing displays - is this expected behaviour?
// DISPLAY THE ASCII KEY CODE IN THE FIRST TEXT FIELD
Dim ConvertedToASCIIEncoding as String = DefineEncoding(inStringToConvert,Encodings.ASCII)
Dim ConvertedASCII_Code as Integer = Asc(ConvertedToASCIIEncoding)
AsciiField.AppendText Str(ConvertedASCII_Code)
I can press Alt -2 for example and all is ok, but Alt alone displays nothing?
How are you acquiring the key? What event? Pressing the Alt key doesn’t trigger a KeyDown event, for example. It is only a modifier. It’s only when you also press the modified key (“2” in your example) that you get a KeyDown.