[jawsscripts] Re: Tab key problems

  • From: "Steve Spamer" <stevespamer68@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 27 Oct 2016 22:03:28 +0100

Bob the script is below, but it is mostly calling functions that move 
through controls in a regular way. For example:
If (nID == idControl1) Then
SetFocus( FindDescendantWindow (hwnd, idControl2))
ElIf (nID == idControl2) Then
SetFocus( FindDescendantWindow (hwnd, idControl3))
etc...

anyway, here's the tab script as it is:
Script Tab ()

Var
    String strLocation,
    String strClass,
    Handle hwnd,
    Int nID

Let strLocation = GetLocation()
Let hwnd = GetRealWindow(GetFocus())
Let strClass = GetWindowClass(GetFocus())
Let nID = GetControlID(GetFocus())

If IsVIPWindow(strLocation) Then
    MoveToNextVIPRing ()
    Return
ElIf IsTransportConsoleWindow(strLocation) Then
    MoveToNextTransportRing ()
    Return
ElIf IsEQ(strLocation) then
    MoveToNextEQ116Control ()
    Return
ElIf IsTrackEditor(strLocation) Then
    MoveToNextTrackEditorRing ()
    Return

ElIf IsMidiVelocityDynamics (strLocation) Then
    MoveToNextMidiVelocityDynamicsControl()
    Return
ElIf IsMidiQuantizeSettings (strLocation) Then
    MoveToNextMidiQuantizeSettingsControl()
    Return
ElIf IsTrackAuxSendRouting(strLocation)
; check if aux bus1 is active
    If (nID == idAuxSendOn1)
|| (nID == idAuxSendGain1)
|| (nID == idAuxSendPre1)
|| (nID == idAuxSendPan1)
|| (nID == idAuxSendVis1) Then
        MoveToNextAux1Controls ()
    Return
; check if aux bus2 is active
    ElIf (nID == idAuxSendOn2)
|| (nID == idAuxSendGain2)
|| (nID == idAuxSendPre2)
|| (nID == idAuxSendPan2)
|| (nID == idAuxSendVis2) Then
        MoveToNextAux2Controls ()
    Return
; check if aux bus3 is active
    ElIf (nID == idAuxSendOn3)
|| (nID == idAuxSendGain3)
|| (nID == idAuxSendPre3)
|| (nID == idAuxSendPan3)
|| (nID == idAuxSendVis3) Then
        MoveToNextAux3Controls ()
    Return
; check if aux bus4 is active
    ElIf (nID == idAuxSendOn4)
|| (nID == idAuxSendGain4)
|| (nID == idAuxSendPre4)
|| (nID == idAuxSendPan4)
|| (nID == idAuxSendVis4) Then
        MoveToNextAux4Controls ()
    Return
; check if aux bus5 is active
    ElIf (nID == idAuxSendOn5)
|| (nID == idAuxSendGain5)
|| (nID == idAuxSendPre5)
|| (nID == idAuxSendPan5)
|| (nID == idAuxSendVis5) Then
        MoveToNextAux5Controls ()
    Return
; check if aux bus6 is active
    ElIf (nID == idAuxSendOn6)
|| (nID == idAuxSendGain6)
|| (nID == idAuxSendPre6)
|| (nID == idAuxSendPan6)
|| (nID == idAuxSendVis6) Then
        MoveToNextAux6Controls ()
    Return
; check if aux bus7 is active
    ElIf (nID == idAuxSendOn7)
|| (nID == idAuxSendGain7)
|| (nID == idAuxSendPre7)
|| (nID == idAuxSendPan7)
|| (nID == idAuxSendVis7) Then
        MoveToNextAux7Controls ()
    Return
; check if aux bus8 is active
    ElIf (nID == idAuxSendOn8)
|| (nID == idAuxSendGain8)
|| (nID == idAuxSendPre8)
|| (nID == idAuxSendPan8)
|| (nID == idAuxSendVis8) Then
        MoveToNextAux8Controls ()
    Else
        MoveToNextTrackAuxSendRoutingMainControls ()
    Return
    EndIf
ElIf IsMidiTranspose(strLocation) Then
    MoveToNextMidiTransposeControl ()
    Return
ElIf IsDynamics(strLocation) Then
    MoveToNextDynamicsControl ()
    Return
ElIf IsAdvancedDynamics(strLocation) Then
    MoveToNextAdvancedDynamicsControl ()
    Return
ElIf IsAmpSimulation(strLocation) Then
    MoveToNextAmpSimulationControl ()
    Return
ElIf IsVocoder(strLocation) Then
    MoveToNextVocoderControl()
    Return

ElIf IsDefaultDialog(strLocation) Then
    TypeCurrentScriptKey()
    Return
ElIf (IsStereoEditor( strLocation)) Then
MoveToNextStereoEditorControl()
    Return
ElIf IsAutomationNodeEdit(strLocation) Then
    TypeCurrentScriptKey()
        Say (msgNextNode, OT_STRING, TRUE)
    ;    MoveToNextAutomationNodeControl()
    Return

ElIf IsResamplingTimeStretching ( strLocation) Then
    TypeCurrentScriptKey()
    Return

ElIf IsMIDIEventList() Then
    If (strClass == clsEdit)
        MoveToNextEventInEventList()
    EndIf

ElIf IsMidiEditor(strLocation) Then
    If (strClass == clsEdit)
MoveToNextEventInMidiEditor ()
    EndIf
ElIf IsStartSelection( strLocation) Then
    TypeCurrentScriptKey()
    Delay(1)
    PerformScript SayWindowPromptAndText ()
    Return


ElIf IsEchoDelayReverb(strLocation) Then
    MoveToNextEchoDelayReverbControl ()
    Return
ElIf IsElasticAudio (strLocation) Then
    MoveToNextElasticAudioControl()
    Return
ElIf IsAudioQuantization (strLocation) Then
MoveToNextAudioQuantizationControl()
    Return
ElIf IsCrossfadeEditor(strLocation) Then
MoveToNextCrossfadeEditorControl()
    Return

/*
; check main aux controls
    If (nID == idAuxSendPlay)
|| (nID == idAuxSendOK)
|| (nID == idAuxSendCancel)
|| (nID == idAuxSendHelp)
|| (nID == idAuxSendBypassAll)
|| (nID == idAuxSendNewAuxBus)
|| (nID == idAuxSendResetAuxBuses) Then
        MoveToNextTrackAuxSendRoutingMainControls ()
    Return
    EndIf
*/

ElIf IsObjectEditorFXTab() Then
    MoveToNextObjectEditorFXControl()
    Return
ElIf IsObjectEditorFadesTab() Then
    MoveToNextObjectEditorFadesControl()
    Return
ElIf IsObjectEditorTimePitchTab() Then
    MoveToNextObjectEditorTimePitchControl()
    Return
ElIf IsMidiGlobalQuantizeSettings() Then
    MoveToNextMidiGlobalQuantizeSettingsControl()
    Return
ElIf IsMIDIObjectEditor() Then
    MoveToNextMIDIObjectEditorControl()
    Return
ElIf  IsVSTParameterFX (strLocation) Then
MoveToNextVSTParameterDialogValue ()
Else
    TypeCurrentScriptKey()
EndIf
EndScript
-----Original Message----- 
From: Bob
Sent: Thursday, October 27, 2016 8:36 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Tab key problems

Difficult to say without seeing what you have done.
Can you show your modified tab script?


On 27 Oct 2016, at 19:51, Steve Spamer <stevespamer68@xxxxxxxxx> wrote:

Bob, how would I prevent the default movement? Any idea on what in
particular to look at? THX Steve.

-----Original Message----- 
From: Bob
Sent: Thursday, October 27, 2016 5:37 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Tab key problems

If the issue is that the default movement is being spoken before the
additional movement you are carrying out is being spoken then you can 
either
prevent the default movement by modifying the tab scripts or if we don't
mind it being a bit inelegant you could use speechoff and speehon.

Bob

On 27 Oct 2016, at 17:16, Jonathan Cohn <jon.c.cohn@xxxxxxxxx> wrote:

Steve,
SetFocus has nothing to do with control ID's it uses Window Handles how
you
get those handles is up to you. You could walk the entire application
window space each time, you could create a cache of window handles on the
create window function. Generally in complex applications either off 
these
would be inefficient but possible. In any case, you are still not being
specific enough about your approach to provide us any alternatives.

If I understand your message, you are getting the geometry or bounds of
the
current control looking at the type of or name of that control and then
moving the mouse to an appropriate place and doing a click action. Click
actions could be causing side effects,

As I mentioned in my previous message one extreme solution would be to
have
the to override GetCurrentControl type functions and not attempt to
actually move focus. Also remember that tab is /shift tab are not to
control an application. Perhaps using using modifier keys with arrow 
might
be a useful way to change parameters. FindDecendantWindow might be your
friend.

Is it possible that some of the controls in this application are using
MSAA
or UIA as a better way to interact with them?
it is

On Thu, Oct 27, 2016 at 8:07 AM Steve Spamer <stevespamer68@xxxxxxxxx>
wrote:

Hi Jonathan. No I'm not using SetFocus, as getting control ID's is not
reliabel at all.
For example, potentially you have approximately 50 controls, if you have
all
the right controls active.  On the other hand you could only have approx
10,
if the opposite is done.

Now the issue is, a control ID that could be assigned to 1 control when
active, is then assigned to another control when it isn't.  Multiply 
that
by
all the possibilities with these controls and it soon gets too confusing
to
keep track of.

So, I am moving to each control with mouse movement from a consistent
reference point. Not ideal I know, but it works...and that's what I'm
interested in at the moment.

So, when I tab, I move correctly with the mouse movement, but Jaws is
also
speaking/picking/setting focus up on some windows/controls that it would
pick up by default, which have no relevance to the actual control I'm 
on.

Example, I press tab and move to the band 1 frequency edit field.  I am
correctly move there and all is well, but jaws will also speak whatever
window the default action would pick up, which could be band 2's gain, Q
frequency etc.

So, if there were no scripts, I could potentially tab through 3 or 4
windows
or focus on some other window and tab through some more, but I want to
ignore that behaviour and only run my functions when pressing tab. THX
Steve.

-----Original Message-----
From: Jonathan Cohn
Sent: Thursday, October 27, 2016 12:35 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Tab key problems

So, you are using SetFocus on the "window" you are attempting to focus
on?
Issues to check:
1. Is the window visible
2. Is the window disabled
3. Did focus actually get set to the item that you did a setFocus on

It could be that this program just does not know how to handle the set
focus
or that the item you are attempting to focus on is actually a composite
with
sub windows?

Only other possibility I can think of is to move the mouse into the
control
you want focus on and then click it. Obviously this would be an issue 
for
buttons. I guess you could have a pseudo focus where you store the 
button
in
a global variable and rewrite any and all commands that speak focus but
that
seems very extreme.end
Best wishes,

Jonathan



On Oct 26, 2016, at 3:50 PM, Steve Spamer <stevespamer68@xxxxxxxxx
<mailto:stevespamer68@xxxxxxxxx>> wrote:

Hi folks.  The situation is I have a window/plug that has a messed up
tab
order, which is also incomplete.
It’s for an EQ plugin and there are 6 bands. Depending on which band
is
turned on, depends on what control is available.
now the issue is control ID’s can’t be depended on, because one
control ID can be assigned  to different controls depending on what’s
active.
Ok, so another approach was needed.  I’ve created a number of
functions
that move to each control using a global variable, e.g,
If (giEQTab == 1) Then
 MoveToControl1().
ElIf (giEQTab == 2) Then
 MoveToControl2().
etc etc etc...
MoveToControl1() has been assigned the value of 1 in the function...and
that in turn is called by â€œMoveToNextEQControl()† in the â€œTabâ€
script and so on.

Now this is working as expected with 1 issue.
When I tab I am correctly moving to the next/previous control, but Jaws
is
also speaking some of the default tab controls that I’ve just
mentioned
are incomplete and have messed up ID’s, and this is annoying.

So, I basically want to move to controls the way I’ve done it without
Jaws speaking/picking up on the default tab behaviour and I’m
confused.
I could assign this to another key, but obviously tab is what I want to
use.  Hope you get the situation. Best Steve.

__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts
<//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


__________�

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: