[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

OpenVMS/Hangul RTL Korean Screen Management (SMG$) Manual


Previous Contents


SMG$SET_KEYPAD_MODE

The Set Keypad Mode routine sets the terminal's numeric keypad to either numeric or applications mode.

Format

SMG$SET_KEYPAD_MODE keyboard-id ,flags


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

keyboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual keyboard whose mode is to be changed. The keyboard-id argument is the address of an unsigned longword that contains the keyboard identifier.

Keyboard-id is returned by SMG$CREATE_VIRTUAL_KEYBOARD.

flags


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Optional bit mask that specifies whether the keypad is to be in applications or numeric mode. The flags argument is the address of an unsigned longword that contains the flag. Valid values for flags are as follows:
0 Keypad is set to numeric mode.
SMG$M_KEYPAD_APPLICATION Keypad is set to applications mode.

Description

SMG$SET_KEYPAD_MODE sets the terminal's numeric keypad to either numeric or applications mode. In applications mode, numeric keypad keys are considered function keys and may be used as terminators. In numeric mode, these keys are equivalent to the corresponding keys on the main keyboard.

If the terminal does not support applications keypad mode, this routine has no effect.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVKBD_ID Invalid keyboard-id.

SMG$SET_OUT_OF_BAND_ASTS

The Set Out-of-Band ASTs routine either enables or disables the trapping of out-of-band control characters.

Format

SMG$SET_OUT_OF_BAND_ASTS pasteboard-id ,control-character-mask ,AST-routine [,AST-argument]


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

pasteboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the pasteboard for which out-of-band characters are enabled or disabled. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Pasteboard-id is returned by SMG$CREATE_PASTEBOARD.

control-character-mask


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Specifies which control characters are to be the new out-of-band control characters. The control-character-mask argument is the address of an unsigned longword that contains the mask. You create this mask by setting the bit that corresponds to the ASCII value of the desired character. For example, to specify that Ctrl/C (ASCII value 3) is an out-of-band control character, you set bit 3 (value 8) in the control-character-mask. If no bits are set in this mask, then no out-of-band ASTs occur.

AST-routine


OpenVMS usage ast_procedure
type procedure value
access read only
mechanism by value

The address of an AST routine to be called when an out-of-band control character is typed at the terminal. The AST-routine argument is the routine's procedure value.

AST-argument


OpenVMS usage user_arg
type longword (unsigned)
access read only
mechanism by value

The argument you supply to the AST. AST-argument is an unsigned longword that contains the value to be passed to the AST routine. However, the AST routine may also need to determine the out-of-band character and the pasteboard-id at which it was typed. Therefore, the Screen Management Facility creates a three-longword structure to hold this information and passes the address of this structure as the first argument to the AST routine. The remaining four arguments are R0, R1, PC, and PSL (on VAX) and PS (on AXP). The Screen Management Facility stores the argument you supply in this structure.

The first longword contains the pasteboard-id and has the symbolic name SMG$L_PBD_ID. The second longword contains the AST-argument and has the symbolic name SMG$L_USER_ARG. The third longword contains the ASCII value of the out-of-band character typed and can be accessed by way of two symbolic names: SMG$B_CHAR (the low-order byte containing the ASCII value), and SMG$L_CHAR (the longword containing the ASCII value in the low-order byte and spaces in the high-order bytes).


Description

SMG$SET_OUT_OF_BAND_ASTS enables or disables the acceptance of out-of-band control characters at the specified terminal. If one of these characters is typed at the terminal, the AST routine is called.

This routine can be used to trap out-of-band characters, such as Ctrl/C, Ctrl/Y, and Ctrl/O.


Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVPAS_ID Invalid pasteboard-id.

Example


!+
! This BASIC example demonstrates the use of
! SMG$SET_OUT_OF_BAND_ASTS.
!-
OPTION TYPE = EXPLICIT
OPTION CONSTANT TYPE = INTEGER

%INCLUDE "$SMGDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"
%INCLUDE "$SSDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"

EXTERNAL LONG FUNCTION SMG$CREATE_PASTEBOARD,       &
                       SMG$CREATE_VIRTUAL_KEYBOARD, &
                       SMG$SET_OUT_OF_BAND_ASTS
EXTERNAL LONG OUT_BAND_ROUTINE

DECLARE LONG S, PASTEBOARD_ID, KEYBOARD_ID, CTRL_MASK

CTRL_MASK = (2%**SMG$K_TRM_CTRLC) + (2%**SMG$K_TRM_CTRLW) + &
            (2%**SMG$K_TRM_CTRLZ)

S = SMG$CREATE_PASTEBOARD (PASTEBOARD_ID)
IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL(S) END IF

S = SMG$CREATE_VIRTUAL_KEYBOARD (KEYBOARD_ID)
IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL(S) END IF

S = SMG$SET_OUT_OF_BAND_ASTS (PASTEBOARD_ID,                  &
                              CTRL_MASK,                      &
                              LOC(OUT_BAND_ROUTINE) BY VALUE, &
                              KEYBOARD_ID BY VALUE)
IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL(S) END IF

SLEEP(60)

END


SUB OUT_BAND_ROUTINE(SMG$R_OUT_OF_BAND_TABLE SMG_INFO,  &
                     LONG R0, LONG R1, LONG PC, LONG PSL)

OPTION TYPE = EXPLICIT

%INCLUDE "$SMGDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"
%INCLUDE "$SSDEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"

EXTERNAL LONG FUNCTION SMG$REPAINT_SCREEN, &
                       SMG$SET_KEYPAD_MODE

DECLARE LONG S, KEYPAD_MODE

IF SMG_INFO::SMG$B_CHAR = SMG$K_TRM_CTRLC
THEN
    PRINT "CTRL/C typed"
END IF

IF SMG_INFO::SMG$B_CHAR = SMG$K_TRM_CTRLZ
THEN
    PRINT "CTRL/Z typed"
    STOP
END IF

IF SMG_INFO::SMG$B_CHAR = SMG$K_TRM_CTRLW
THEN
    S = SMG$REPAINT_SCREEN (SMG_INFO::SMG$L_PBD_ID)
    IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL(S) END IF

    KEYPAD_MODE = SMG$M_KEYPAD_APPLICATION

    S = SMG$SET_KEYPAD_MODE (SMG_INFO::SMG$L_USER_ARG, KEYPAD_MODE)
    IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL(S) END IF
END IF

SUBEND

      


SMG$SET_PHYSICAL_CURSOR

The Set Cursor on Physical Screen routine moves the physical cursor to the specified position on the pasteboard.

Format

SMG$SET_PHYSICAL_CURSOR pasteboard-id ,pasteboard-row ,pasteboard-column


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

pasteboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the pasteboard whose physical cursor is to move. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Pasteboard-id is returned by SMG$CREATE_PASTEBOARD.

pasteboard-row


OpenVMS usage longword_signed
type longword (signed)
access read only
mechanism by reference

Specifies the row to which the physical cursor moves. The pasteboard-row argument is the address of a signed longword that contains the row number.

pasteboard-column


OpenVMS usage longword_signed
type longword (signed)
access read only
mechanism by reference

Specifies the column to which the physical cursor moves. The pasteboard-column argument is the address of a signed longword that contains the column number.

Description

SMG$SET_PHYSICAL_CURSOR moves the physical cursor to the specified row and column position on the specified pasteboard. This routine should not be used when pasteboard batching is in effect.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVPAS_ID Invalid pasteboard-id.
SMG$_INVARG Invalid column.

SMG$SET_TERM_CHARACTERISTICS

The Change Terminal Characteristics routine changes or retrieves the terminal characteristics for a given pasteboard.

Format

SMG$SET_TERM_CHARACTERISTICS pasteboard-id [,on-characteristics1] [,on-characteristics2] [,off-characteristics1] [,off-characteristics2] [,old-characteristics1] [,old-characteristics2]


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

pasteboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the pasteboard whose characteristics are to be changed or retrieved. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Pasteboard-id is returned by SMG$CREATE_PASTEBOARD.

on-characteristics1


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Bit mask that specifies the terminal characteristics to be set from $TTDEF. The on-characteristics1 argument is the address of an unsigned longword that contains the bit mask.

on-characteristics2


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Bit mask that specifies the terminal characteristics to be set from $TT2DEF. The on-characteristics2 argument is the address of an unsigned longword that contains the bit mask.

off-characteristics1


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Bit mask that specifies the terminal characteristics to be reset from $TTDEF. The off-characteristics1 argument is the address of an unsigned longword that contains the bit mask.

off-characteristics2


OpenVMS usage mask_longword
type longword (unsigned)
access read only
mechanism by reference

Bit mask that specifies the terminal characteristics to be reset from $TT2DEF. The off-characteristics2 argument is the address of an unsigned longword that contains the bit mask.

old-characteristics1


OpenVMS usage mask_longword
type longword (unsigned)
access write only
mechanism by reference

Retrieves the current terminal characteristics in the first group. The old-characteristics1 argument is the address of an unsigned longword that contains the bit mask.

old-characteristics2


OpenVMS usage mask_longword
type longword (unsigned)
access write only
mechanism by reference

Retrieves the current terminal characteristics in the second group. The old-characteristics2 argument is the address of an unsigned longword that contains the bit mask.

Description

SMG$SET_TERM_CHARACTERISTICS changes or retrieves the terminal characteristics for a given pasteboard. The characteristics are defined by the $TTDEF and $TT2DEF macro modules in Digital-supplied system symbol libraries. A benefit of using this routine is that it allows you to control multiple terminal characteristics in a single routine call.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_NOT_A_TRM Pasteboard is not a terminal.
SS$_xyz Errors from LIB$QIOW.

Example


10      !+
        ! This VAX BASIC program demonstrates the use of the
        ! SMG$SET_TERM_CHARACTERISTICS routine.
        !-

        OPTION TYPE = EXPLICIT
        OPTION CONSTANT TYPE = INTEGER

        %INCLUDE "$SSDEF"  %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"
        %INCLUDE "$TTDEF"  %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"
        %INCLUDE "$TT2DEF" %FROM %LIBRARY "SYS$LIBRARY:BASIC$STARLET"

        DECLARE LONG S, PASTEBOARD_ID, ON_1, ON_2, OFF_1, OFF_2, OLD_1, OLD_2

        EXTERNAL LONG FUNCTION LIB$SIGNAL( LONG BY VALUE ),     &
                               SMG$CREATE_PASTEBOARD( LONG ),   &
                               SMG$SET_TERM_CHARACTERISTICS( LONG, LONG, &
                               LONG, LONG, LONG, LONG, LONG )

        !+
        ! Create the pasteboard
        !-

        S = SMG$CREATE_PASTEBOARD( PASTEBOARD_ID )
        IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL( S ) END IF

        !+
        ! Terminal characteristics to be set
        !-

        ON_1 = TT$M_LOWER
        ON_2 = TT2$M_EDITING + TT2$M_EDIT

        !+
        ! Terminal characteristics to be reset
        !-

        OFF_1 = TT$M_WRAP + TT$M_MECHTAB
        OFF_2 = TT2$M_PASTHRU + TT2$M_INSERT

        !+
        ! Change the characteristics of the terminal line associated
        ! with the pasteboard.  They will be reset at image exit or when
        ! SMG$DELETE_PASTEBOARD is called. The previous characteristics
        ! are returned in OLD_1 and OLD_2.
        !-

        S = SMG$SET_TERM_CHARACTERISTICS( PASTEBOARD_ID, ON_1, ON_2, &
                                          OFF_1, OFF_2, OLD_1, OLD_2 )
        IF S <> SS$_NORMAL THEN CALL LIB$SIGNAL( S ) END IF

        IF (OLD_1 AND TT$M_WRAP) <> 0
        THEN
            PRINT "WRAP was set"
        ELSE
            PRINT "NOWRAP was set"
        END IF

        IF (OLD_2 AND TT2$M_ANSICRT) <> 0
        THEN
            PRINT "Pasteboard is an ANSI terminal"
        ELSE
            PRINT "Pasteboard is not an ANSI terminal"
        END IF


        END

      


SMG$UNPASTE_VIRTUAL_DISPLAY

The Remove Virtual Display routine removes a virtual display from a pasteboard.

Format

SMG$UNPASTE_VIRTUAL_DISPLAY display-id ,pasteboard-id


RETURNS


OpenVMS usage cond_value
type longword (unsigned)
access write only
mechanism by value


Arguments

display-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the virtual display to be removed from a pasteboard. The display-id argument is the address of an unsigned longword that contains the display identifier.

Display-id is returned by SMG$CREATE_VIRTUAL_DISPLAY.

pasteboard-id


OpenVMS usage identifier
type longword (unsigned)
access read only
mechanism by reference

Specifies the pasteboard from which the virtual display is removed. The pasteboard-id argument is the address of an unsigned longword that contains the pasteboard identifier.

Description

SMG$UNPASTE_VIRTUAL_DISPLAY removes the specified display from the specified pasteboard, and thus from the screen associated with the pasteboard. This routine does not destroy the virtual display or its contents; it only removes its association with a particular pasteboard and its visibility on the screen. Any text occluded by the specified virtual display becomes visible again.

Condition Values Returned

SS$_NORMAL Normal successful completion.
SMG$_INVPAS_ID Invalid pasteboard-id.
SMG$_INVDIS_ID Invalid display-id.
SMG$_WRONUMARG Wrong number of arguments.
SMG$_INVARG Invalid argument. The specified virtual display is not pasted to the specified pasteboard.
SMG$_NOTPASTED The specified virtual display is not pasted to the specified pasteboard.

Previous Contents Contents