From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: The new text-mode menu and the cursor in -nw mode Date: Tue, 29 Apr 2014 17:24:02 +0300 Message-ID: <83k3a8mcxp.fsf@gnu.org> References: <87d2g1iqzp.fsf@fx.delysid.org> <83d2g1o2lc.fsf@gnu.org> <87wqe98goi.fsf@fx.delysid.org> <831twhnvnq.fsf@gnu.org> <87lhup5kro.fsf@fx.delysid.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1398781462 8532 80.91.229.3 (29 Apr 2014 14:24:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 14:24:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Mario Lang Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 29 16:24:15 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wf8xC-0001i3-4G for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2014 16:24:14 +0200 Original-Received: from localhost ([::1]:50162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf8xB-00036Q-A3 for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2014 10:24:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf8x1-0002tP-7z for emacs-devel@gnu.org; Tue, 29 Apr 2014 10:24:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wf8wu-0001mO-Ia for emacs-devel@gnu.org; Tue, 29 Apr 2014 10:24:03 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:53834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wf8wu-0001lz-4h for emacs-devel@gnu.org; Tue, 29 Apr 2014 10:23:56 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N4S00A00QAOM500@mtaout28.012.net.il> for emacs-devel@gnu.org; Tue, 29 Apr 2014 17:22:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N4S005B5QLJDF70@mtaout28.012.net.il>; Tue, 29 Apr 2014 17:22:31 +0300 (IDT) In-reply-to: <87lhup5kro.fsf@fx.delysid.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171653 Archived-At: > From: Mario Lang > Date: Mon, 28 Apr 2014 21:14:35 +0200 > > >> However, as mention in this thread, what is important to both > >> groups, is that the hardware cursor position is update if the > >> currently "highlighted" area of the screen changes, so that the > >> screen reader can "follow" the hightlight around on the screen. > > > > That's exactly what bothers me: updating a menu might, and generally > > will, change more than one place on the screen. As a trivial example, > > moving to the next menu item will redraw both the one which was > > highlighted before and the one that is to be highlighted now. Screen > > readers will probably read both (and the help echo in between them), > > and I'm not sure the user will understand what is going on, not > > without some training. > > I am not really sure about speech based screen readers, but some have > ways to cope with very fast screen updates, and present the changes in a > "meaningful" way. All I know, as a braille user, is that the hardware > cursor position is essential to indicate the highlighted area. Screen > update ordering is totally irrelevant to me, since the screen updates > happen way to fast to actually "see" them. However, what I need is the > hardware cursor on the highlighted item, such that my screen reader > shows the text "around" the highlight area, instead of going stuck in > the middle of the currently active window. Please try the patch below. If it gives good results, I will install it. Thanks. --- src/term.c~0 2014-03-21 08:34:40 +0200 +++ src/term.c 2014-04-29 17:20:24 +0300 @@ -2897,6 +2897,13 @@ tty_menu_display (tty_menu *menu, int x, menu_help_paneno = pn - 1; menu_help_itemno = j; } + /* Take note of the coordinates of the active menu item, to + display the cursor there. */ + if (mousehere) + { + row = y + i; + col = x; + } display_tty_menu_item (menu->text[j], max_width, face, x, y + i, menu->submenu[j] != NULL); } @@ -3177,6 +3184,7 @@ tty_menu_activate (tty_menu *menu, int * bool first_time; Lisp_Object selectface; int first_item = 0; + int col, row; /* Don't allow non-positive x0 and y0, lest the menu will wrap around the display. */ @@ -3364,6 +3372,11 @@ tty_menu_activate (tty_menu *menu, int * faces, x, y, first_item, 1); tty_hide_cursor (tty); fflush (tty->output); + /* The call to display help-echo below will move the cursor, + so remember its current position as computed by + tty_menu_display. */ + col = cursorX (tty); + row = cursorY (tty); } /* Display the help-echo message for the currently-selected menu @@ -3373,6 +3386,10 @@ tty_menu_activate (tty_menu *menu, int * { help_callback (menu_help_message, menu_help_paneno, menu_help_itemno); + /* Move the cursor to the beginning of the current menu + item, so that screen readers and other accessibility aids + know where the active region is. */ + cursor_to (sf, row, col); tty_hide_cursor (tty); fflush (tty->output); prev_menu_help_message = menu_help_message;