Previous Topic Next topic Print topic


Detecting Adis Function Keys

If you have set up an Adis key to act as a function key, it terminates the ACCEPT operation, and key-status is returned with the following values:

Data Item Setting
key-type "2"
key-code-1 Set to the number of the pressed enhanced ACCEPT/DISPLAY syntax key. This is the number of the key not the number of the function the key has been mapped to.
key-code-2 Undefined.

Example

The following code sets up Tab and Backtab to act as function keys and the cursor-left and cursor-right keys to act as function keys if they cause the cursor to leave the field.

* Set up Tab (key 8) and Backtab (Key 9) to act as function 
* keys
     move 1 to adis-key-setting
     move 8 to first-adis-key
     move 2 to number-of-adis-keys
     call x"AF" using set-bit-pairs
                      adis-key-control
* Set up cursor-left (key 3) and cursor-right (key 4) to act 
* as function keys ONLY if they cause the cursor to leave  
* the field.
     move 3 to adis-key-setting
     move 3 to first-adis-key
     move 2 to number-of-adis-keys
     call x"AF" using set-bit-pairs
                      adis-key-control
     accept data-item at 0101

     if key-type = "2"
         evaluate key-code-1
          when 3  display "cursor-left caused the cursor " &
                          "to leave the field"
          when 4  display "cursor right caused the cursor " &
                          "to leave the field"
          when 8  display "the tab key was pressed"
          when 9  display "the back tab key was pressed"
         end-evaluate
     end-if.
Previous Topic Next topic Print topic