How to Just Trap CTRL, ALT, or SHIFT Keys in Basic (59131)
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
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q59131 SUMMARY
Normally, to trap CTRL (CONTROL), ALT, and SHIFT in combination with
other keys, you would set the bits for these keys in the first byte
(keyboard flag) of the two CHR$() bytes in the KEY statement.
However, to trap the CTRL, ALT, and SHIFT keys alone (not in
combination with other keys), the keyboard flag in the KEY statement
should be CHR$(0) for the standard keyboard or CHR$(&H80) for keys
specific to an extended keyboard.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB59131 |
---|
|