In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

Version 3 Technical Highlights - KBStatus

A function which returns an integer which indicates which special keyboard keys are pressed down at the time that the routine is called. To find out whether a particular key is active it is necessary to BITAND the result with a specific integer as shown in the following table. If the BITAND returns false then the key is not pressed.

           1   The Right Shift key
           2   The Left  Shift Key
           3   Left/Right Shift
           4   The Ctrl Key
           8   The Alt Key
          16   The Scroll Lock Key
          32   The Num Lock Key
          64   The Caps Lock Key
         128   Insert Key

Thus to check whether the user was pressing Right-Shifted-Alt the following code segment would suffice


0001    Declare Function KbStatus
0002    Loop
0003      Input X,-1
0004    Until X = \1B\
0005      If BitAnd(KbStatus(),1) Then
0006       If BitAnd(KbStatus(),8) Then
0007        Print Char(7) :
0008       End
0009      End
0010    Repeat

(Volume 4, Issue 5, Pages 11,12)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel