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

  • From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2009 09:08:21 -0700

One way I've done this, is by using the following method

Let TextString = GetTextInRect (GetWindowLeft (GetCurrentWindow()), 
GetWindowTop (GetCurrentWindow()), GetWindowRight (GetCurrentWindow()), 
GetWindowBottom (GetCurrentWindow()), 0, ci_editorSelectedTextClr, 
ci_editorSelectedBGClr, true)


I used the NewTextEvent function to append the following color values to the 
clipboard, nTextColor and nBackgroundColor, in order to get the desired 
color values when performing the action that produced the text with these 
color combinations, then created a couple of constants to hold these values.

This should reliably announce the text that you desire when calling the 
function.


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


> Hi Doug,
> This is in Dreamweaver CX4. When you type the string "</," the program 
> types in the rest of the tag it thinks you should close. I'm pretty sure 
> that that's the only text that will come to the screen. I found out that 
> the color name is blue4. The text will always be entered just to the left 
> of where the cursor ends up and on the same line. I could probably route 
> the invisible cursor to the PC cursor after I detect that I've typed a </, 
> but that wouldn't do it in all situations and it would be weird to code. I 
> also tried to figure out how get color text could give me the exact color 
> so that I could try to make sure that I spoke the right text, but I wasn't 
> sure how to map it back to the number on the line in colors.ini that had 
> the blue4.
>
> 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
>
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx 
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
> Sent: Thursday, August 13, 2009 4:14 PM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Can You Tell If Text Is On Same Line As Cursor
>
> 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
>
>
> 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

Other related posts: