Addon development: how to switch focus to another NVDA object?


Samuel Kacer
 

Hello all,

 

I am currently developing an addon and I am trying to figure out how to have NVDA jump to another NVDA object.

 

Essentially I am wanting for when the user presses NVDA + E, the current focused object’s siblings are searched and the first one that is editable text is focused. Here is my code:

    @script(gesture = 'kb:NVDA+e')

    def script_findEditor(self, gesture):

        # get the first sibling of focused object

        obj = api.getFocusObject().simpleParent.simpleFirstChild

        while obj is not None:

            if obj.role is controlTypes.ROLE_EDITABLETEXT:

                obj.setFocus()

                return

            obj = obj.simpleNext

        ui.message('couldnt find editor.')

 

 

I am developing this for use in IntelliJ which uses Java Access Bridge GUI. It does not work as expected, if the object doesn’t have a editor sibling it correctly outputs the message, but if it does, it doesn’t output the message and nothing happens.

 

Some help in understanding why it might not be working is greatly appreciated.

 

Kind Regards,

Sam

 

 


 

Sam,

            This question is far more likely to get the audience you're looking for on the NVDA Development group.


Although there are a few folks who are developers who post here, the bulk of us are end users who don't have any real working knowledge regarding the actual source code for NVDA itself nor any add-ons.   By contrast, the NVDA Development group is dedicated to that.

--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 


Luke Davis
 

Or possibly better, the nvda-addons group:

nvda-addons+subscribe@groups.io

Luke

On Sat, 31 Aug 2019, Brian Vogel wrote:

Sam,            This question is far more likely to get the audience you're looking for on the NVDA Development group.
* Post: nvda-devel@groups.io
* Subscribe: nvda-devel+subscribe@groups.io
* Unsubscribe: nvda-devel+unsubscribe@groups.io
* Group Owner: nvda-devel+owner@groups.io
* Help: nvda-devel+help@groups.io
Although there are a few folks who are developers who post here, the bulk of us are end users who don't have any real working knowledge regarding the actual
source code for NVDA itself nor any add-ons.   By contrast, the NVDA Development group is dedicated to that.--


 

On Sat, Aug 31, 2019 at 07:36 PM, Luke Davis wrote:
Or possibly better, the nvda-addons group:
Indeed.  It would help if their group description were a little more thorough, though.  I didn't look at the messages and the group description is relatively vague.

Both of those groups are "coder central" with regard to NVDA and NVDA Add-Ons.
 
--

Brian - Windows 10 Pro, 64-Bit, Version 1903, Build 18362  

The color of truth is grey.

           ~ André Gide

 

 


Luke Davis
 

Blimy! You've got that right, LOL. I never actually looked at the description.

I'll drop James and Joseph a line and see if we can get this amended a bit.

Luke

On Sat, 31 Aug 2019, Brian Vogel wrote:

On Sat, Aug 31, 2019 at 07:36 PM, Luke Davis wrote:
Or possibly better, the nvda-addons group:
Indeed.  It would help if their group description were a little more thorough, though.  I didn't look at the messages and the group description is
relatively vague.Both of those groups are "coder central" with regard to NVDA and NVDA Add-Ons. --


 

Hi,

This is the (currently in vacation) chief admin of add-ons list speaking...

There is an ongoing discussion (offlist) on updating the NVDA add-ons list description.

As for the problem posed by Sam: are there ways to use JAB for retrieving control type information? That might be more preferable, given that sometimes object navigation emulation (because that's what Sam is trying to do at the moment) might not work on all apps.

Let's discuss this further on the add-ons list (and if needed, on development list if it turns out there are things to change from NVDA itself).

Cheers,

Joseph