Saturday, July 4, 2020

Implementing Cursor Select key functionality

LIGHT PEN CAPABILITY OF THE 3270 STYLE TERMINALS

One feature available on 3270 type terminals is the light pen. This is a pen shaped object on the end of the flexible cable (actually a fiber optic cable). When it is pointed at certain fields on the screen which are defined with the ability to be selected, the control unit (CU) sends a selection status to the mainframe indicating which field was selected using the pen. 

The attribute byte interprets its 2 bit display field as 
  • 00 - Normal, not selectable
  • 01 - Normal, selectable
  • 10 - Intensified, selectable
  • 11 - Hidden, not selectable
Fields that are marked selectable must also have a specific designator character after the attribute. There are two broad categories of these fields, selection fields and attention fields. The selection field allows the operator to select an item usually from a list but does not signal the host of this event. The attention field on the other hand does signal the host.

If the field has a question mark as the designator character, it is a selection field. If the light pen or CURS SEL key is used with the cursor in that field, the CU will change the ? to a > character which is a visual indication that it was selected. This field is marked modified so that the host can read modified fields at some later time and get this. The user can hit a selected field again and reset it to unmodified with a ? displayed.

There are two subtypes of attention fields. Both create an event (similar to when the operator hits a key like ENTER or PA1 or PF5). With a designator of space or null, what is transmitted to the host with that event is only the address of the field that was selected by the pen or CURS SEL key. If the designator is &, then the event sends back both the address and the rest of the data in that selected field. 

CURS SEL KEY ROLE

The CURS SEL key is provided for those who do not have a light pen attachment on the terminal or who wish to use the keyboard exclusively. When the cursor is in a field that is set up as selectable, if the CURS SEL key is pressed and the designator character is ?, >, &, space or null, then it behaves just as if the light pen had been touched to that field. 

IMPLEMENTATION

I added a test function in the Buffer object, isSelectable, to be used when the CURS SEL key is detected. When processing that key, I retrieve the first character of the field itself and interpret it as the designator. If not a designator, the keypress is ignored. If it is a ? or >, I toggle the character in the buffer.  If it is an &, space or null, I issue a print indicating that we had an attention selection event.


1 comment:

  1. It appears that to the host, the two attention fields produce ATTN and ENTER events (AIDs) with the ATTN event having the address in the buffer of the attention field that was chosen.

    ReplyDelete