Return to Works Index

Keyboard Maps and the Status Bar

The status bar is the 24th line on a screen and is reserved for showing what special keys are active at any point in a program and what they do.

In order to accommodate different keyboards, the status bar display is based on a combination of the name of the key supplied from a keyboard mapping utility and the function of the key defined by the program.

When a user logs in, and they are not on a standard VT style keyboard, their LOGIN.COM needs to run DSILIB:SET_KEYBOARD_MAP as follows:

$ @DSILIB:DSI SET_KEYBOARD_MAP <map-name> Where <map-name> is a valid keyboard map in the keyboard map database. This program defines three symbols (DSI$KEYBOARD_MAP_1, 2 and 3) which contain the keyboard map.

The maps are created and maintained by the utility program DSILIB:KEYBOARD_MAP_MAINT.EXE.

Programming The include file DSILIB:ENTER_BASIC.INC contains the definitions for the status bar. This include file allocates three arrays, DSI$SB_NAME, DSI$SB_TEXT and DSI$SB_SEQ, and declares the following constants, which are used as indexes into the arrays:

SBK_PF1 SBK_F6 SBK_ALT_0
SBK_PF2 SBK_F7 SBK_ALT_1
SBK_PF3 SBK_F8 SBK_ALT_2
SBK_PF4 SBK_F9 SBK_ALT_3
SBK_FIND SBK_F10 (SBK_EXIT) SBK_ALT_4
SBK_INSERT_HERE SBK_F11 SBK_ALT_5
SBK_REMOVE SBK_F12 SBK_ALT_6
SBK_SELECT SBK_F13 SBK_ALT_7
SBK_PREV_SCREEN SBK_F14 SBK_ALT_8
SBK_NEXT_SCREEN SBK_F17 SBK_ALT_9
SBK_HELP SBK_F18 SBK_ALT_PERIOD
SBK_DO SBK_F19 SBK_ALT_COMMA

SBK_F20 SBK_ALT_MINUS
SBK_ALT_ENTER



Note that SBK_F10 and SBK_EXIT are the same value and that there is no SBK_F15 or SBK_F16 (They are SBK_HELP and SBK_DO).

DSI$SB_NAME contains the name of the key on the keyboard that is mapped into the VT key. For example, if on a PC keyboard the "Num Lock" key is used for PF1 then DSI$SB_NAME(SBK_PF1) should contain the string "Num Lck". The values in this array are defined using DSILIB:KEYBOARD_MAP_MAP to define maps of the key names. A program should not alter this array.

DSI$SB_TEXT contains a short description of what the key does. So if a program uses PF1 to produce a list then DSI$SB_TEXT(SBK_PF1) should contain the string "List". SETUP loads values for FIND, INSERT, REMOVE, SELECT, PREV, NEXT, HELP, DO and EXIT. Any other values must be assigned by a program after the call to SETUP.

DSI$SB_SEQ contains the escape sequence for each key for use when a mouse press selects a key from the status line. It normally should not be changed.

The status bar can now be displayed by using the following directive:

	$DSI STATUS_BAR SBK_EXIT, SBK_DO, SBK_PF1

Up to 12 parameters can be used at any one time.

If a program had the following code :

	CALL SETUP
DSI$SB_TEXT(SBK_PF1)= 'List'
	$DSI STATUS_BAR SBK_EXIT, SBK_DO, SBK_PF1

then, on a DEC keyboard the status line would show :

	F10=Exit Do PF1=List

Note that if both the key name and text are the same (ignoring case) then only the text shows.

The same call on a PC keyboard where "End" is mapped to SELECT and "Num Lock" is mapped to PF1 produces the following line :

	F10=Exit End=Do Num Lck=List