[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about triggering KEY_MOUSE

From: Thomas Dickey
Subject: Re: Question about triggering KEY_MOUSE
Date: Tue, 1 Jan 2019 19:25:14 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Jan 01, 2019 at 02:45:00PM -0600, Bryan Christ wrote:
> When I want push keys into an application running in my terminal emulator,
> it's typically just a matter of writing the correct sequence to the pty
> file descriptor with a some mapping for special keys.  For example, if I
> read KEY_F(1) then I turn around and write ESC[11~ (as prescribed by rxvt
> termdesc) to the pty and it gets picked up by the application on the other
> end.  I assumed that supporting the mouse would be pretty much the same.
> If I read KEY_MOUSE then I write ESC[M and expect that the running app
> would pick up KEY_MOUSE.
> I can see from my data traps that the application (using ncurses) sent a
> ESC[?1000h sequence meaning "SET_VT200_MOUSE".  What I am questioning is
> what should I be writing back?  ESC[CbCxCyM where Cx and Cy are X10 encoded
> coords?  If so, does that mean that the coord values are limited to 223?

xterm's control sequences document is the place to look:

            Ps = 1 0 0 0  -> Send Mouse X & Y on button press and
          release.  See the section Mouse Tracking.  This is the X11
          xterm mouse protocol.
            Ps = 1 0 0 1  -> Use Hilite Mouse Tracking, xterm.
            Ps = 1 0 0 2  -> Use Cell Motion Mouse Tracking, xterm.
            Ps = 1 0 0 3  -> Use All Motion Mouse Tracking, xterm.
            Ps = 1 0 0 4  -> Send FocusIn/FocusOut events, xterm.
            Ps = 1 0 0 5  -> Enable UTF-8 Mouse Mode, xterm.
            Ps = 1 0 0 6  -> Enable SGR Mouse Mode, xterm.

If you don't see a 1006 mode (such as ESC[?1006;100h) then yes, you're
limited to 223.

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]