[jawsscripts] Re: Breaking a While Loop using Key Press Function?

  • From: Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 1 Jun 2012 17:59:24 -0400

I bet you could wrap a getKeyState() call in a function that returns
the isDown status for the key you want, provided it's one of the
shift-type keys (shift, ctr, alt, etc.). No need for isKeyWaiting()
for that, since isKeyWaiting() is only concerned with keys that
transmit keycodes. Modifier keys don't do that when not pressed with
something else.

On Fri, Jun 01, 2012 at 04:32:23PM -0500, Travis Roth wrote:
IsKeyWaiting() returns true or false.
To do what you want you'd have to make your own which would be rather
involved and require most likely another script/event to monitor for the
specific key and toggle a global variable.

And depending on what your while loop is doing its any bet if the
script/event would get fired.It probably would if your loop calls Pause() I
suppose. Seems like a lot of work though.
 

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Saylien Brown
Sent: Friday, June 01, 2012 4:21 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Breaking a While Loop using Key Press Function?

Ok, would something like the following do the trick?

While (Condition == TRUE && Not IsKeyWaiting ()) ... Do the following ...
EndWhile

The above While Loop will continue to run until I press any key? Is there a
way to add a parameter to IsKeyWaiting () to force it to check to see if the
[Ctrl] key is being pressed down? Would like to tweak the function to check
for a specific key press, not just any key being pressed on the keyboard.
Thanks for your assistance.

At 04:37 PM 6/1/2012, you wrote:
>Just use it as a condition in the while loop, it returns true when a 
>key is waiting.
>While(isKeyWaiting()==true && whatever else) ...
>EndWhile
>
>
>-----Original Message-----
>From: jawsscripts-bounce@xxxxxxxxxxxxx
>[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Saylien Brown
>Sent: Friday, June 01, 2012 2:45 PM
>To: jawsscripts@xxxxxxxxxxxxx
>Subject: [jawsscripts] Re: Breaking a While Loop using Key Press Function?
>
>How would I use this isKeyWaiting () function in the proper syntax to 
>break a While Loop? Can you give me an example code using the [Ctrl] 
>key as an example?
>
>At 02:38 PM 6/1/2012, you wrote:
> >Try the isKeyWaiting() function.
> >
> >-----Original Message-----
> >From: jawsscripts-bounce@xxxxxxxxxxxxx 
> >[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Saylien Brown
> >Sent: Friday, June 01, 2012 12:27 PM
> >To: jawsscripts@xxxxxxxxxxxxx
> >Subject: [jawsscripts] Breaking a While Loop using Key Press Function?
> >
> >Hello,
> >
> >Ok, I'm getting into some pretty advanced scripting that involves the 
> >While Loop function.
> >
> >I generally build a fail safe into all of my while loops...
> >
> >VAR
> >Int iX
> >
> >Let iX = 0
> >
> >While (This=True && iX <= 20)
> >...Do the following...
> >EndWhile
> >
> >But sometimes I wish to stop a While Loop manually, so I find myself 
> >always pressing the [Control] key, but of course nothing happens.
> >
> >Is there anyway to replace my fail safe ix = 20 with say KeyPress != 
> >[Control]? Would give me more flexibility to kill a While Loop by 
> >simply pressing the Ctrl key.
> >
> >If this is possible, please share the coding, so I can model it for 
> >my own needs.
> >
> >Thanks for any help.
> >
> >__________o?=
> >
> >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
>
>__________???
>
>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

__________???

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

-- 
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
__________�

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

Other related posts: