qck.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Shift Arguments and Bit Fields
                        ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 Shift Arguments and Bit Fields
 
 ■ To test for the Shift argument, declare constants that define the bits in
   the argument by loading the CONSTANT.BI file into each module using the
   $INCLUDE metacommand. Shift constants have the following values:
 
         Constant       Value
         ══════════     ════════════════════════════════════════════════════
         SHIFT_MASK     1
         CTRL_MASK      2
         ALT_MASK       4
 
 ■ Shift constants act as bit masks that you can use to test for any button
   combination.
 
 ■ You test for a condition by first assigning each result to a temporary
   integer variable and comparing Shift to a bit mask. Use the AND operator
   with the Shift argument to test whether the condition is greater than 0,
   indicating that the modifier has been pressed. For example:
 
         ShiftDown% = (Shift AND SHIFT_MASK) > 0
         CtrlDown% = (Shift AND CTRL_MASK) > 0
 
 ■ You can test for any combination of conditions in a procedure. For
   example:
 
         IF ShiftDown% AND CtrlDown% THEN BEEP
 
   See: ◄KeyDown Event►  ◄KeyUp Event►