Keyascii

From Wikipedia, the free encyclopedia

KEYASCII is a term used to identify a key that is pressed on a computer keyboard. The term comes from the combining of KEY + ASCII. ASCII is an industry standarad method of identifying keys. IBM has its own method.

When you are programming an application, it is possible to tell the computer to ignore a key that has been pressed. You do this by scanning for a keycode and then processing the information, only if it appropriate.

Click here to visit a page that explains KEYASCII and other keycode scan values well:

[1]

Here is an example of a procedure written in VB6.0.

Private Sub txtBox_KeyPress(KeyAscii As Integer)
 Select Case KeyAscii
   Case 45, 46, 47, 48 To 57, 65 To 90, 97 To 122 'Acceptable keystrokes (ASCII char numbers)
   Case Else
        KeyAscii = 0 'Any other key press should be ignored (changed to NULL)
 End Select
End Sub