Adis ファンクション キーの検出

Adis キーをファンクション キーとして動作するように設定している場合は、ACCEPT 操作を終了して、key-status が次の値で返されます。

データ項目 設定
key-type "2"
key-code-1 押された拡張 ACCEPT/DISPLAY 構文キー番号。このキー番号は、キー マッピングされた機能番号ではありません。
key-code-2 未定義

次のコードは、Tab および Backtab キーをファンクション キーとして動作するように設定します。また、左矢印および右矢印キーを、カーソルがフィールドから出る場合に、ファンクション キーとして動作するように設定します。

* 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.