[jawsscripts] Re: colour checking issue some hsc howTos's.

  • From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 7 May 2010 09:35:44 +1000

Hi Sean/scripters.

Jackie's of course absolutely right on this, my view.

I haven't had nearly the same level of experience Jackie has on this, but I
have had a fair bit of experience examining color changes at spots on the
screen with the jaws Cursor, and, she's bang on the money I reckon, with the
advice given below, to alter your home/Utility row mode, to one pixel rather
than the default 3. Then crawl along/around  the area,
clicking the mouse as you go, until you find an actual pixel where the color
change is actually reflected.  And, of course, ahem, I couldn't let this
opportunity go by without just shamelessly plugging, hee hee,
<grin,> that HotSpotClicker indeed does have some very handy little builtIns
for sussing this kind of stuff, when connected to the application obviously,
through a "use hotspotClicker.jsb"
statement at the top of the app's script file.


after recompiling the script file obviously,
and thus, "connecting," hsc in this way, AltTabbing to the application
will cause hsc to shove a whole bunch of it's own controller keystrokes
into the keymap for the application, after first of course automatically
backing up the original keyMap in case you want to get it back for some
reason.
They are all relatively obscure, but there are quite a fiew of them, but
none of them overRide in any way, any jawsDefault keystrokes. so you should
be relatively safe.
<grin.>

Then, what you then can do, is use alt+shift+NumPad Arrows, to crawl
along/around the area you reckon should be reflecting the color change,
and, hsc, by default, will automatically announce the color at each pixel
you arrive at.  you can repeat this by hitting alt+shift+NumPad5 of course,
and, a very, very  nice feature Jim has provided here, you can then
double click AltShiftNumPad5 to copy that color Value to the clipboard, for
pasting into your relevant scripts!
real sweet! now, you'll notice a bit of a delay before it reports each
coloredAtPoint, as you altShiftArrow around. this is by design.  What jim's
also very elegantly done here, is provided a way of being able to thus
altShiftArrow around speedily, over a given area, and, provided time for the
next altShiftArrow press to interrupt what would otherwise prove a very
annoyingly chattery and verbose output from this feature.
So then, you can altShiftArrow around quite fast, and you will hear a beep,
very immediately, when a color changed pixel is detected.  So then you can
stop there, and listen for the new color at that pixel point.
This auto announce color feature, if it proves too annoying and you wish to
just do things manually, which is what I tend to prefer myself, can also be
toggled off through the use of the keystroke, Alt+control+shift+Comma.
now, Right next to this, i.e. alt+control+Shift+Period, is another feature I
tend to disable, which is set on by default in hsc, which is to also
automatically announce when/that your on a graphic, as you navigate with
altShiftArrows.

Tip: there's another handy little feature, which is a oneShot Bookmark
keystroke, which is Alt+Shift+NumPadPageUp.  Which should say, "set
bookmark." then, you can investigate around a bit, and when you wanna jump
back to this point, simply press alt+shift+NumPadPageDown, to return to that
spot again. jut handy sometimes.
Another kinda handy investigative tool here, is hitting alt+Shift+NumPad
Home, which should say, Set Reference.  if you do that, then mouse around to
another point, an you wanna know the distance of your reference position, to
the new position your mouse is now on, press alt+shift+End. hsc will
announce the distance in x y pixels, from your reference position to your
currnet one.

Not that this will probably be particularly relevant to you if your
examining what your doing, but to round out this explanation completely of
these tools, I should also point out that if you find you've got a large
portion of the screen of the same color, what you can also do, is get
reeeeal acrobatic with your fingers, and tuck one of your fingers in next to
your altKey, and, whilst holding down alt+shift, as you normally do when
investigating this, also press down the windows key.  So then you should
have alt+Windows+Shift+Arrows.
this will cause hsc to just automatically jump to the next point onscreen
where the color does change, even if only very slightly, by a different
shade of the same color etc.  This can also be handy for more large scale
investigations.

now, the color is usually announced as a colorname, like grey81,
followed by it's absolute value. for various reasons, this is by default,
spoken in an RGB 9 digit type format.
As jackie points out though, usually you may need this in an integer value
instead. no problem. hsc can flip the output of this easily under the
verbosity menu, jawsKey+v, when hsc is connected, you'll see a few options
globally switchable.  SayColorFormat, is one of them. simply toggle it with
spaceBar, from RGB, to Integer.
This changed format value will of course also be reflected in what gets
coppied to the clipboard with doublePress of altShiftNumPad5.

remember that sometimes, due to color shadings and things, crawling along an
area, i.e. on one single pixel line, may not be sufficient, in locating a
pixel where the colorChange will be reflected. often you have to crawl in a
fairly crazy random method, just around the area, clicking the mouse then
checking with altShiftNumPad5 all the while, to check when you find a pixel
where the color change is actually reflected.

I haven't got time right now to be going into this fully, but, if your
prepared to have your client press another key to check the state of your
checkBoxes, which I know is not optimal, but just so's people know, you can
set things up with hsc such that when defining the hotspot, it'll actually
track the position of the pc Cursor/focus, and, with some experimentation,
to see whether you need to get it to track row, or column, or both row and
Column, definable in the very first, "positioning," mode dialog that hsc
offers when initially defining your hotspot,
if your color change pixel is, as it should usually be, a set x/y distance
from your pcCursor focus, then you can get hsc to be making it's spot,
dynamically trackable with the pcCursor.  Then, what you'd do is, use the
Alt+Control+Shift+f3, Assign Post processing  function keystroke. then
firstly, choose the hotspot name to which you wish to assign this function.
the next dialog, should offer you a list of BuiltIn post processing
functions to choose from.  Choose, HscDecodeHotSpotColor.
Press enter on that, and you will be told, to activate the Hotspot by
pressing the key you assigned to it.  your not in any fancy dialogs at this
point, but back in your normal application.
so, then you press your hotspot key.  Hsc then goes to your spot, clicks
left mouseButton, if th'ats the action you've assigned to the spot when
defining it, which is normative,
checks the color, and asks you to select a function to run when xx color is
found.
Select, "hsDSayPhraseByColor, by pressing enter.
then you will be asked to type the phrase when xx color is found. type
Checked/unChecked, as situation demands, and press enter.
Then, if you've got your spot correctly defined, press your hotspot key
again.  if you've set your spot action up to be a leftMouse Click, which is
normative, then the mouse wil go there, click again, and the color should
change. thus, you'll be then asked to go through the above process again, of
first selecting the function to run when xx, a new color hopefully, is
found. choose hsdSayPhraseByColor again, press enter, then type the
word/phrase associated with that color, and press enter.

be warned though, this will happen for as many new colors as hsc finds when
it clicks on this given pixel. so careful spot definitions are in order
here.

hth.


geoff c.
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, May 07, 2010 2:16 AM
Subject: [jawsscripts] Re: colour checking issue


> Hi, Sean:
>
> Colors in Jaws are dodgy at best. I've had quite a bit of experience
> w/this sort of thing in a forensics app I've written scripts for, that
> did just what you're saying, & I'll tell u what I did, in case it
> helps.
>
> 1) Be advised that the sayColor() function, called when insert
> keyboard 5 is pressed, is notably inaccurate. You'd be better off
> creating your own script that says the color at the active cursor
> column & row for a particular set of coordinates, using either
> GetColorAtPoint or GetColorText. Both functions return an integer, so
> use sayinteger to get your return value. Often the color changes in
> the middle of the line as opposed to the beginning, so you've got to
> locate precisely where that occurs, as well as what color the checked
> vs unchecked portion actually is. My guess is that either you've got
> the location or the color incorrect.
>
> What u have to do is:
> a) Adjust your global mouse pixels to 1 in home row;
> b) figure out at what cursor position the text starts at;
> c) Go to the beginning of the line, &, for every pixel until the start
> of the actual text, get the color for the checked & unchecked state so
> u can see where it changes.
>
> As u can see, it is a royal pita! U might actually want to make a
> script that does this for u automatically.
>
> I would also advise that u not include this in keypressedEvent, but
> actually write a spacebar script for this. That's what I did, & it
> worked well.
>
> If u feel I can help u more w/this, let me know & maybe we can do a
> skype call or something.
>
> On 5/5/10, sean farrow <sean.farrow@xxxxxxxxxxxxxxxx> wrote:
> > Hi:
> > I am in the process of checking for a colour in a set of scripts i'm
> > writing.
> >
> > The colour changes when the spacebar is pressed.
> >
> > I'm currently doing the following in KeyPressedEvent, not the best palce
I
> > know, I carn't use new text event, asx the whole app is one window, Any
> > other events come to mind?
> >
> > If GetColorAtPoint(x, y) ==Colour then
> >
> > SayString"test" //simulate the checked state of a checkbox.
> >
> > Else
> >
> > SayString "Unckecked"
> >
> > The if clause seems to execute all the time, but not the else.
> >
> > Anyone any idea why?
> >
> > Also should i use colorToRGBString rather than the colour value it'self.
> >
> > Any help appreciated.
> >
> > Regards
> >
> > Sean.
> >
> >
> > __________�
> >
> > View the list's information and change your settings at
> > //www.freelists.org/list/jawsscripts
> >
> >
>
>
> -- 
> Change the world--1 deed at a time
> Jackie McBride
> www.abletec.serverheaven.net
> Please join me Saturday, 11/7, on my walk against breast cancer by
> making a donation at:
> http://main.acsevents.org/goto/larkspur>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>

__________�

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

Other related posts:

  • » [jawsscripts] Re: colour checking issue some hsc howTos's. - Geoff Chapman