[GB.FORM.TERMINAL]

* NEW: Finish the VT100 Escape codes list.


git-svn-id: svn://localhost/gambas/trunk@7677 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2016-03-27 10:07:17 +00:00
parent 2fdd19cf4a
commit e0265cfac2

View file

@ -430,3 +430,28 @@ OSC Ps ; Pt BEL
4 6 Change Log File to Pt (normally disabled by a compile-time option)
5 0 Set Font to Pt If Pt begins with a "#", index in the font menu, relative (if the next character is a plus or minus sign) or absolute. A number is expected but not required after the sign (the default is the current entry for relative, zero for absolute indexing).
======================================================= Mouse ================
Mouse Tracking
The VT widget can be set to send the mouse position and other informa- tion on button presses. These modes are typically used by editors and other full-screen applications that want to make use of the mouse.
There are six mutually exclusive modes. One is DEC Locator mode, enabled by the DECELR CSI Ps ; Ps 'z control sequence, and is not described here. The remaining five modes are each enabled (or disabled) by a different parameter in DECSET CSI ? Pm h or DECRST CSI ? Pm l con- trol sequence.
Manifest constants for the parameter values are defined in xcharmouse.h as follows:
#define SET_X10_MOUSE 9
#define SET_VT200_MOUSE 1000
#define SET_VT200_HIGHLIGHT_MOUSE 1001
#define SET_BTN_EVENT_MOUSE 1002
#define SET_ANY_EVENT_MOUSE 1003
The motion reporting modes are strictly xterm extensions, and are not part of any standard, though they are analogous to the DEC VT200 DECELR locator reports.
Parameters (such as pointer position and button number) for all mouse tracking escape sequences generated by xterm encode numeric parameters in a single character as value+32. For example, ! specifies the value 1. The upper left character position on the terminal is denoted as 1,1.
X10 compatibility mode sends an escape sequence only on button press, encoding the location and the mouse button pressed. It is enabled by specifying parameter 9 to DECSET. On button press, xterm sends CSI M CbCxCy (6 characters). Cb is button-1. Cx and Cy are the x and y coor- dinates of the mouse when the button was pressed.
Normal tracking mode sends an escape sequence on both button press and release. Modifier key (shift, ctrl, meta) information is also sent. It is enabled by specifying parameter 1000 to DECSET. On button press or release, xterm sends CSI M CbCxCy. The low two bits of Cb encode button information: 0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release. The next three bits encode the modifiers which were down when the button was pressed and are added together: 4=Shift, 8=Meta, 16=Control. Note however that the shift and control bits are normally unavailable because xterm uses the control modifier with mouse for popup menus, and the shift modifier is used in the default translations for button events. The Meta modifier recognized by xterm is the mod1 mask, and is not nec- essarily the "Meta" key (see xmodmap). Cx and Cy are the x and y coor- dinates of the mouse event, encoded as in X10 mode.
Wheel mice may return buttons 4 and 5. Those buttons are represented by adding 64 to the event code.
Mouse hilite tracking notifies a program of a button press, receives a range of lines from the program, highlights the region covered by the mouse within that range until button release, and then sends the program the release coordinates. It is enabled by specifying parameter 1001 to DECSET. Highlighting is performed only for button 1, though other but- ton events can be received. Warning: use of this mode requires a coop- erating program or it will hang xterm. On button press, the same infor- mation as for normal tracking is generated; xterm then waits for the program to send mouse tracking information. All X events are ignored until the proper escape sequence is received from the pty: CSI Ps ; Ps ; Ps ; Ps ; Ps T . The parameters are func, startx, starty, firstrow, and lastrow. func is non-zero to initiate hilite tracking and zero to abort. startx and starty give the starting x and y location for the highlighted region. The ending location tracks the mouse, but will never be above row firstrow and will always be above row lastrow. (The top of the screen is row 1.) When the button is released, xterm reports the ending position one of two ways: if the start and end coordinates are valid text locations: CSI t CxCy. If either coordinate is past the end of the line: CSI T CxCyCxCyCxCy. The parameters are startx, starty, endx, endy, mousex, and mousey. startx, starty, endx, and endy give the starting and ending character positions of the region. mousex and mousey give the location of the mouse at button up, which may not be over a character.
Button-event tracking is essentially the same as normal tracking, but xterm also reports button-motion events. Motion events are reported only if the mouse pointer has moved to a different character cell. It is enabled by specifying parameter 1002 to DECSET. On button press or release, xterm sends the same codes used by normal tracking mode. On button-motion events, xterm adds 32 to the event code (the third charac- ter, Cb). The other bits of the event code specify button and modifier keys as in normal mode. For example, motion into cell x,y with button 1 down is reported as CSI M @ CxCy. ( @ = 32 + 0 (button 1) + 32 (motion indicator) ). Similarly, motion with button 3 down is reported as CSI M B CxCy. ( B = 32 + 2 (button 3) + 32 (motion indicator) ).
Any-event mode is the same as button-event mode, except that all motion events are reported instead of just those that enter a new character cell. It is enabled by specifying 1003 to DECSET.