INKEY$ Returns Two-Byte String for Arrow and Function Keys (30844)
The information in this article applies to:
- Microsoft Visual Basic for MS-DOS
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
This article was previously published under Q30844 SUMMARY
The INKEY$ function returns a one- or two-byte string. Alphanumeric
keys return one-byte strings. The function keys and the directional
keys return two-byte strings.
If INKEY$ returns a two-byte string, then each byte needs to be
examined to determine the key that was pressed. For two-byte strings,
the first byte will always be null [an ASCII value of zero, CHR$(0)],
and the second byte will be the key's scan code. The LEN function
tells you the length of the returned string (one byte or two).
The ASCII and keyboard scan codes are listed in Appendix A of the
Microsoft Visual Basic version 1.0 for MS-DOS Reference Manual.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB30844 |
---|
|