cmd
= 0 pixel
= 0 Enable or disable the DEC locator feature.
The DEC locator feature is a mouse tracking mode. If cmd
= 1 or cmd
= 2 it is activated. Otherwise it's disabled. If pixel
= 1 the reports will be send in pixels otherwise in cells.
If cmd
= 2 the locator will be enabled in single shot mode. In this mode it's automatically disabled after one report. Otherwise enable the locator until it's disabled by a later use of this sequence (or terminal reset).
On pointer events the terminal sends the following:
ESC[Ⓝ;Ⓝ;Ⓝ;Ⓝ&w
Where event
is either a 0, 1, 10 or one of the following:
event | Meaning |
---|---|
0 | pointer is outside the terminal (either on dec locator report current position, dec locator watch pointer leave or a mouse button event |
1 | on dec locator report current position with pointer inside the terminal and reporting enabled |
2 | left button pressed |
3 | left button released |
4 | middle button pressed |
5 | middle button released |
6 | right button pressed |
7 | right button released |
9 | scroll wheel up |
11 | scroll wheel down |
10 | pointer left watch rectangle or pointer entered terminal (while watching for pointer enter) |
16 | button 8 pressed |
17 | button 8 released |
18 | button 9 pressed |
18 | button 9 released |
and state
encodes the pressed buttons after the event (e.g. on release of the last button it is 0, on press of the left button it is 4). The left button is bit 2, the middle button is bit 1 and the right button is bit 0. Other buttons show up in state
as bit (button number - 1) but only if that button was pressed/release in this event.
x
and y
are the pointer coordinates. If pixel mode was selected in pixels otherwise in cells.
When a pointer press or release event is reported while watching the pointer the DEC locator is deactivated.
See also dec locator watch pointer leave, dec locator select events and dec locator report current position.