This article was previously published under Q26485
This article has been archived. It is offered "as is" and will no longer be updated.
I am unable to trap the PRINT SCREEN key (on an IBM extendedkeyboard, such as on an IBM AT) when pressed simultaneously with theALT, SHIFT, or CTRL key. However, these can be trapped, with theexception of CTRL+PRINT SCREEN, within the QuickBasic editingenvironment.
These keys can be trapped using GW-Basic Interpreter Version 3.20. Thefollowing is a code example:
Response:This problem results because the value &H80 is missing from thekeyboardflag argument of the KEY statement. You must add this valuewhenever you trap the PRINT SCREEN key on an extended keyboard.Make sure the Num Lock, Caps Lock, and Scroll Lock keys are all in theoff position when you are trapping keys with this method.
The correct method for trapping the key is as follows: