WHERE Standard

ViaDuct

To enable, disable, and select options for the WHERE feature programmatically, the following character sequences can be output to the mvTerm Client (on the data channel) from the application program running on the mvBase Server.

Format

<ESC><CTRL+H>MOUSE {Options} {OFF} {ON} {TEST} {WHERE} {WAIT} {c,r}<CTRL+H>

Parameter(s)

OFF

Disables WHERE (options retained).

ON

Enables WHERE.

TEST

Checks for the existence of a mouse and returns the number of enabled mouse buttons.

WHERE

Returns current screen position of mouse cursor and status of mouse button (pressed or released).

WAIT

Waits for next mouse activity and when sensed, does an immediate WHERE command.

c,r

Moves the mouse cursor to the specified screen position (c = column, r = row).

Options

Options can be specified in upper or lowercase (ie, /P+ or /p+). These options are supported:

/P+

Monitor button press.

/P-

No monitoring of button press.

/R+

Monitor button release.

/R-

No monitoring of button release.

/C+

Monitor button click.

/C-

No monitoring of button click.

/D+

Monitor button double click.

/D-

No monitoring of button double click.

/In

Prefix click information message with ASCII n character.

/In,n

Prefix click information message with 2 ASCII n characters.

The mouse click functionality provides support for the following features:

The WHERE message is sent from the mvTerm Client to the application program running on the mvBase Server when a selected mouse event occurs. It starts off with 1 or 2 lead-in characters, followed by an event type value that indicates the type of event that caused the message to be sent, followed by a space character (x’32’), followed by an event data string containing the mouse information data parameters associated with the event (each parameter separated by a space character), followed by a checksum value for validating that the mouse information values are correct, and ending with a carriage return character to terminate the message.

The WHERE message is sent when an event occurs that is specified in the MOUSE options. This mouse information message has the format:

<c1><c2><eventtype><SPACE><eventdata><SPACE><chksum><CR>

Parameter(s)

Field

Description

<c1>

First lead-in character (In option).

<c2>

Second lead-in character (In , n option).

<eventtype>

Number for event that caused message to be sent.

<SPACE>

Space character (x ’32’).

<eventdata>

Mouse information data parameters for event (parameters separated by space character).

<chksum>

Sum of the <eventtype> and <eventdata> parameters.

<CR>

Carriage return (x’0d’).

The responses for the various MOUSE command variations are listed below. The first number in each case is the <eventtype> value.

 

Response to TEST subcommands

0<SPACE><button><SPACE><chksum><button> = number of buttons (0 = no mouse).

Response to WHERE and WAIT subcommands

1<SPACE><button><SPACE><col><SPACE><row><SPACE> <chksum>

<button> = buttons down (0=neither, 1=left, 2= right, 3=both)

<col> = column

<row> = row

Response to button pressed with /P+ option in effect

2<SPACE><button><SPACE><col><SPACE><row><SPACE> <chksum>

<button> = buttons down (1=left, 2= right)

<col> = column

<row> = row

Response to button released with /P+ and /R+ options in effect

3<SPACE><button><SPACE><col><SPACE><row><SPACE> <chksum>

<button> = buttons down (1=left, 2= right)

<col> = column

<row> = row

Response to button released with /P- and /R+ options in effect.

This combines press and release information for drag type operations. If the press and release are at the same screen position, the response is an <eventtype> of 3 (see above definition) with an additional possibility of <button> = 3 (both). If the press and release are at different screen positions, the following response is generated:

4<SPACE><button><SPACE>><col><SPACE><row><SPACE><pcol><SPACE><prow><SPACE> <chksum>

<button> = buttons down (1=left, 2= right, 3=both)

<col> = release column

<row> = release row

<pcol> = press column

<prow> = press row

Response to button clicked with /C+ and /D+ options in effect

5<SPACE><button><SPACE><col><SPACE><row><SPACE> <chksum>

<button> = buttons down (1=left, 2= right, 3=both)

<col> = column

<row> = row

Response to button double click with /D+ option in effect

6<SPACE><button><SPACE><col><SPACE><row><SPACE> <chksum>

<button> = buttons down (1=left, 2= right, 3=both)

<col> = column

<row> = row

If the MOUSE command’s default options (/P- /R- /C- /D-) are in effect when the WHERE is enabled, the mouse activity must be constantly checked with the WHERE or WAIT subcommand. To avoid this constant query, at least one of the /P+ /R+ /C+ /D+ options needs to be specified.

If the combination of the /P- and /R+ options are specified, when the user clicks a button, the application program receives a mouse information message containing which button was pressed and the position of the mouse cursor (<eventtype> = 3). The user can press the mouse button, move the mouse to a different position while keeping the button down, and then release the button (drag operation). In this case, a reverse video marker is displayed on the screen to remind the user of the location where the button was pressed. When the user releases the button, the reverse video marker is removed and the application program receives a mouse information message containing which button was pressed and the press and release positions of the mouse cursor (<eventtype> = 4).

If the combination of the /P+ and /R+ options are specified, the application program receives mouse information messages when the button is pressed (<eventtype> = 2) and when the button is released (<eventtype> = 3). For a drag type operation (press and release at different positions), no reverse video marker is displayed on the screen and the application program receives 2 separate mouse information messages (1 for press, 1 for release). If the application program needs to detect that both the left and right buttons were pressed together, it requires message handling for each button pressed and released individually.

If the combination of the /P+ and /R- options are specified, the application program receives a mouse information message when the button is pressed (<eventtype> = 2). For a drag type operation (press and release at different positions), no reverse video marker is displayed on the screen and the application program (after receiving the mouse information press message) loops continuously, monitoring the mouse button activity (with a WHERE or WAIT subcommand) for button moves and a release. The WAIT subcommand sends mouse information messages (<eventtype> = 1) whenever the user presses a mouse button, moves the mouse, or releases a mouse button.

AccuTerm

To enable, disable, and select options for the WHERE feature programmatically, the following character sequences can be output to the mvTerm Client (on the data channel) from the application program running on the mvBase Server.

<ESC><STX>1

Enable WHERE.

<ESC><STX>0

Disable WHERE.

The WHERE message that is sent from the mvTerm Client to the application program running on the mvBase Server is broken up into two submessages.

The first submessage contains a lead-in character (<STX>) that indicates that the following data is WHERE and is followed by a single alpha character representing the button and whether the button was single or double clicked.

The second submessage contains the row and column values of the position where the button was clicked. This mouse information message has the following format:

<STX><button><CR><col><PERIOD><row><CR>

where <button> is:

<button>

Description

p

Left single click.

q

Right single click.

s

Middle single click.

P

Left double click.

Q

Right double click.

S

Middle double click.

<col>

Column (3 digit integer).

<row>

Row (2 digit integer).

<PERIOD>

Period character (x’2e’)

CR>

Carriage return (x’0d’)

On mouse button single clicks, a single click message is sent when the mouse button is released. On mouse button double clicks, three WHERE messages are sent. The first message is a single click message followed by two double click messages.

Terminal/HostAccess

To enable, disable, and select options for the WHERE feature programmatically, the following character sequences can be output to the mvTerm Client (on the data channel) from the application program running on the mvBase Server.

<ESC>{=27;<setting>h

Enable WHERE.

<ESC>{=27I

Disable WHERE.

where:

<setting>

Description

1

Monitor left button press.

2

Monitor right button press.

4

Monitor middle button press.

8

Continuously send addresses while button is pressed.

65

Monitor left button double click.

66

Monitor right button double click.

68

Monitor middle button double click.

The enable character sequence contains a <setting> value (integer) that determines which mouse event causes mouse information messages to be sent from the mvTerm Client to the application program running on the mvBase Server. The WHERE message that is sent from the mvTerm Client to the application program running on the mvBase Server when a selected mouse event occurs is broken up into two submessages.

The first submessage contains a lead-in character (<STX>) followed by MS that indicates that the following data is WHERE.

The second submessage contains three parameters separated by a comma delimiter. The first parameter is a numeric digit indicating which button(s) was pressed. The second and third parameters contain the row and column values of the position where the button(s) was pressed. The WHERE is sent when the button is pressed.

This mouse information message has the following format:

<STX>MS<CR><button><COMMA><row><COMMA><col><CR>

where:

<button>

Description

0

Button(s) released (only continuously send addresses option (=8)).

1

Left button pressed.

2

Right button pressed.

3

Left and right buttons pressed.

4

Middle button pressed.

5

Left and middle buttons pressed.

6

Right and middle buttons pressed.

7

Left, middle, and right buttons pressed.

65

Left button double clicked.

66

Right button double clicked.

68

Middle button double clicked.

<col>

Column (integer – minimum number of digits).

<row>

Row (integer – minimum number of digits).

<comma> =

Comma character (x’2c’).

<cr>

Carriage return (x’0d’).

If the option to continuously send mouse addressees (=8) is specified when enabling the WHERE feature, mouse messages is sent from the mvTerm Client to the application program running on the mvBase Server for the left, middle, or right button when the button is pressed, moved, or released. The button release message is only sent when in this continuous mode.

See Also

Using Enhanced Programmable Mouse Click Features

Allowing Mouse Enabling

Terminal Emulation vs. Terminal Emulator

mvBase Selection-Button Settings