emacs-devel
[Top][All Lists]
Advanced

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

Re: Making TTY menus more visual


From: Eli Zaretskii
Subject: Re: Making TTY menus more visual
Date: Sun, 04 Oct 2020 09:22:08 +0300

> Date: Sat, 03 Oct 2020 12:26:49 -0700
> From: Jared Finder <jared@finder.org>
> Cc: emacs-devel@gnu.org
> 
> >> 1. Add a new command that calls menu-bar-open with the right value for
> >> initial-x. (this is the patch 001 in the root of the thread)
> > 
> > But patch 001 also includes unrelated parts, the tmm-menubar-item-at-x
> > function etc., right?
> 
> tmm-menubar-item-at-x is a new function to share the conversion of a 
> mouse X to a specific menu item between tmm-menubar and the newly added 
> command, menu-bar-open-mouse.
> 
> There's no new code there, it's the existing logic in tmm-menubar.

OK, but then this function should be in menu-bar.el, and its name
shouldn't begin with "tmm-".  tmm-menubar.el will then use it.

> > This should already work; it does in the MS-Windows build when Emacs
> > is invoked with -nw.  Please tell more why you think any changes there
> > are needed.  Perhaps you could take me through the code there and
> > explain what is missing and why.  (And why do you call posn-x-y in the
> > patch when X and Y are already known and used by that code? is that
> > because mouse_get_xy does not yet support xterm-mouse? if so, that
> > support should be added via the terminal's mouse_position_hook.)
> 
>  From injecting debug logs into read_menu_input, I can observe that 
> tty-menu-mouse-movement is never received so the highlighted item never 
> changes except due to keyboard input. And from tracing 
> xterm-mouse--read-event-sequence, it appears that Emacs normally does 
> not receive xterm mouse motion events unless a button is pressed.
> 
> This appears to be due to xt-mouse sending event code 1002 instead of 
> 1003 (see 
> https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking).
> 
> Just sending 1003 instead doesn't just work, but I do see mouse events 
> now coming through. Let me do some more investigation here and I will 
> get back to you.

Thanks.



reply via email to

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