[jawsscripts] Re: Can You Tell If Text Is On Same Line As Cursor

  • From: Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Thu, 13 Aug 2009 16:14:19 -0400

Unfortunately there is no direct way, since the NewTextEvent does not
give us location information.  Brian's idea can work if text tends to
be unique enough not to cause false positives.  You might also be able
to narrow it down by making sure the hwnd passed to the NewTextEvent
is the same as getFocus().  If you really want to be careful, you can
also check colors where the text is found on the current line (using
Brian's suggestion) against those passed to the NewTextEvent.  That
might be a lot of work though, both for you and for the very busy
NewTextEvent.

Perhaps the best way, though more indirect, would be to have the
NewTextEvent keep a copy of the current line and its coordinates,
check these against the new current line and its coordinates on each
call, and decide that way whether this particular call is altering the
current line.  Equal coordinates and unequal text mean yes.  Unequal
coordinates mean no or we don't know.  Equal coordinates and equal
text mean no for sure, or at least, if this event is for the current
line, it's just redrawing something that was already there.

On Thu, Aug 13, 2009 at 01:06:29PM -0700, Bryan Garaventa wrote:
I would try something like this...
Within the NewTextEvent function, check to see if the buffer string is 
contained within the string returned by GetLine().
Is that what you had in mind?


----- Original Message ----- 
From: "Homme, James" <james.homme@xxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, August 13, 2009 11:47 AM
Subject: [jawsscripts] Can You Tell If Text Is On Same Line As Cursor


> Hi,
> When new text event fires, can you tell if the text that comes onto the 
> screen is on the same line as the cursor in some way?
>
> Thanks.
>
> Jim
>
> ----------
> Jim Homme
> Usability Services
> 412-544-1810
> james.homme@xxxxxxxxxxxx
>
> "Strength does not come from physical capacity. It comes from an 
> indomitable will." -- Mahatma Gandhi
>
>
>
> This e-mail and any attachments to it are confidential and are intended 
> solely for use of the individual or entity to whom they are addressed.  If 
> you have received this e-mail in error, please notify the sender 
> immediately and then delete it.  If you are not the intended recipient, 
> you must not keep, use, disclose, copy or distribute this e-mail without 
> the author's prior permission.  The views expressed in this e-mail message 
> do not necessarily represent the views of Highmark Inc., its subsidiaries, 
> or affiliates.
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
> 

__________?
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: