all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Mario Lang <mlang@delysid.org>
Cc: emacs-devel@gnu.org
Subject: Re: The new text-mode menu and the cursor in -nw mode
Date: Tue, 29 Apr 2014 17:24:02 +0300	[thread overview]
Message-ID: <83k3a8mcxp.fsf@gnu.org> (raw)
In-Reply-To: <87lhup5kro.fsf@fx.delysid.org>

> From: Mario Lang <mlang@delysid.org>
> 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;



  reply	other threads:[~2014-04-29 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 12:21 The new text-mode menu and the cursor in -nw mode Mario Lang
2014-04-28 16:12 ` Eli Zaretskii
2014-04-28 18:14   ` Mario Lang
2014-04-28 18:42     ` Eli Zaretskii
2014-04-28 19:14       ` Mario Lang
2014-04-29 14:24         ` Eli Zaretskii [this message]
2014-04-29 15:20           ` Mario Lang
2014-04-29 15:36             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k3a8mcxp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mlang@delysid.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.