Topics

trouble with events

Gianluca Casalino
 

                Dear all,

I am implementing a new version of the addon for supporting Braille Music Editor.

Now it doeas exactly what the jaws script does, but I am encountering some issues using events.

I need evet_gainFocus, event_caret event_typedCharacer, evet_valueChange and event_stateChange.

In all cases it seems the are performed more than once.

Most of them I solved using for example

If eventHandler.isPendingEvents(“caret”) etc etc, but using event_stateChange I can not limit the calls.

I should only check if an object is checked or not and say something when it changes the check status.

Using eventHandler.isPendingEvents(WstateChange”) does not solve in this case.

Have you got some suggestions?

Thansk in advance

 

 

 

Gianluca Casalino

Biblioteca Italiana Ciechi

"Regina Margherita" Onlus                     

Via G. Ferrari 5/A

20900 Monza (MB)

gianluca.casalino@...

www.bibliotecaciechi.it

tel. +3903928327217

fax. +39039833264

 

Le informazioni contenute nel presente messaggio sono riservate e sono destinate esclusivamente al/ai destinatari in esso indicato/i.

Nel rispetto del D.Lgs 196/2003 e s.s. modificazioni, qualora riceviate il presente messaggio per errore, Vi preghiamo di voler cortesemente darcene notizia via fax (039833264) o e-mail (bic@...) e di provvedere a distruggere il messaggio ricevuto erroneamente, essendo ogni utilizzo, divulgazione, distribuzione o copia dello stesso vietata dalla Legge.

L'indirizzo e-mail in questione è da utilizzarsi anche nel caso il ricevente volesse essere cancellato dalla Banca Dati dell'Ente Biblioteca Italiana Ciechi.

Per tale operazione Vi preghiamo di rispondere a tale indirizzo riportando come oggetto: "Cancellazione dalla mailing list”

 

 

Hi,

Is this coming from a single object or multiple ones? If the former, I think the most sensible approach would be an overlay class unless it comes from multiple objects, in which case filtering (conditional statements) might help.

Cheers,

Joseph

 

From: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> On Behalf Of Gianluca Casalino
Sent: Monday, April 6, 2020 6:47 AM
To: nvda-addons@nvda-addons.groups.io
Subject: [nvda-addons] trouble with events

 

                Dear all,

I am implementing a new version of the addon for supporting Braille Music Editor.

Now it doeas exactly what the jaws script does, but I am encountering some issues using events.

I need evet_gainFocus, event_caret event_typedCharacer, evet_valueChange and event_stateChange.

In all cases it seems the are performed more than once.

Most of them I solved using for example

If eventHandler.isPendingEvents(“caret”) etc etc, but using event_stateChange I can not limit the calls.

I should only check if an object is checked or not and say something when it changes the check status.

Using eventHandler.isPendingEvents(WstateChange”) does not solve in this case.

Have you got some suggestions?

Thansk in advance

 

 

 

Gianluca Casalino

Biblioteca Italiana Ciechi

"Regina Margherita" Onlus                     

Via G. Ferrari 5/A

20900 Monza (MB)

gianluca.casalino@...

www.bibliotecaciechi.it

tel. +3903928327217

fax. +39039833264

 

Le informazioni contenute nel presente messaggio sono riservate e sono destinate esclusivamente al/ai destinatari in esso indicato/i.

Nel rispetto del D.Lgs 196/2003 e s.s. modificazioni, qualora riceviate il presente messaggio per errore, Vi preghiamo di voler cortesemente darcene notizia via fax (039833264) o e-mail (bic@...) e di provvedere a distruggere il messaggio ricevuto erroneamente, essendo ogni utilizzo, divulgazione, distribuzione o copia dello stesso vietata dalla Legge.

L'indirizzo e-mail in questione è da utilizzarsi anche nel caso il ricevente volesse essere cancellato dalla Banca Dati dell'Ente Biblioteca Italiana Ciechi.

Per tale operazione Vi preghiamo di rispondere a tale indirizzo riportando come oggetto: "Cancellazione dalla mailing list”

 

Gianluca Casalino
 

Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is added or removed from obj.states, but I do not know how to acomplish that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee <@joslee> ha scritto:

I

Noelia Ruiz
 

Hello, as a uggestion (not tested), have you tried to use the event at
appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your
add-on for BME is updated to be compatible with NVDA 2019.3. Can you
inform about this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:

Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is added
or removed from obj.states, but I do not know how to acomplish that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there are
multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I


Gianluca Casalino
 

I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19")
even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event at appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your add-on for BME is updated to be compatible with NVDA 2019.3. Can you inform about this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:

Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is
added or removed from obj.states, but I do not know how to acomplish that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I


Noelia Ruiz
 

Thanks, I see you have fixed it. Please let us know when this can be
used with NVDA 2019.3.
Kind regards

2020-04-07 8:03 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:

I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19")
even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io>
Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event at
appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your add-on
for BME is updated to be compatible with NVDA 2019.3. Can you inform about
this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino
<gianluca.casalino@...>:
Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is
added or removed from obj.states, but I do not know how to acomplish
that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I







Gianluca Casalino
 

Yes. I could be considered ready. I have to perform some cosmetic improvements and prepare some little documentation.
I have never pubblished works on github, but probably this addon is very important and I should spend some time to put it there.
Thanks you again

-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:11
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thanks, I see you have fixed it. Please let us know when this can be used with NVDA 2019.3.
Kind regards

2020-04-07 8:03 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:

I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19") even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io>
Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event at
appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your add-on
for BME is updated to be compatible with NVDA 2019.3. Can you inform about
this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino
<gianluca.casalino@...>:
Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is
added or removed from obj.states, but I do not know how to acomplish
that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I







Noelia Ruiz
 

Thank you. When you have a download to link the addon file, let us know and I will inform to the spanish user. He cannot update NVDA since he needs thisadd-on.
If we can help with GitHub don"t esitate to ask. Ciao
Enviado desde mi iPhone

El 7 abr 2020, a las 9:17, Gianluca Casalino <gianluca.casalino@...> escribió:

Yes. I could be considered ready. I have to perform some cosmetic improvements and prepare some little documentation.
I have never pubblished works on github, but probably this addon is very important and I should spend some time to put it there.
Thanks you again

-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:11
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thanks, I see you have fixed it. Please let us know when this can be used with NVDA 2019.3.
Kind regards

2020-04-07 8:03 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:
I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19") even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io>
Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event at
appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your add-on
for BME is updated to be compatible with NVDA 2019.3. Can you inform about
this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino
<gianluca.casalino@...>:
Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED is
added or removed from obj.states, but I do not know how to acomplish
that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I











Gianluca Casalino
 

Hi,
if it is urgent I can provide a pre-release. All is working fine.
There are actually these little issues that there was already in the past :

1- Now the midi window as all others (for instance the part window) is correctly handled. There is only two controls for which I have to investigate.
2- the Braille when route cursor does not invoke probably all events and so the midi note is not played (jaws does it. When you route the cursor it works as you move phisically the caret).
I do not know how to acomplish this.

3- the most important is that I can not handle the review cursor.
TO work Ishould always retrive the characer coordinates on the screen (points).
Unfortunately when I use getPointFromoffset and similar functions I get always an error.
The last is that there is a listbox handled a little bit bad. It is focused but are not spoken the number of elements and the current number of focused element.
I do not know how to fix this.
Anyway the addon makes all things (even better) it did in the past and makes alot of new things.


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:47
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thank you. When you have a download to link the addon file, let us know and I will inform to the spanish user. He cannot update NVDA since he needs thisadd-on.
If we can help with GitHub don"t esitate to ask. Ciao Enviado desde mi iPhone

El 7 abr 2020, a las 9:17, Gianluca Casalino <gianluca.casalino@...> escribió:

Yes. I could be considered ready. I have to perform some cosmetic improvements and prepare some little documentation.
I have never pubblished works on github, but probably this addon is very important and I should spend some time to put it there.
Thanks you again

-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io
<nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:11
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thanks, I see you have fixed it. Please let us know when this can be used with NVDA 2019.3.
Kind regards

2020-04-07 8:03 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:
I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19") even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io
<nvda-addons@nvda-addons.groups.io>
Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event
at appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your
add-on for BME is updated to be compatible with NVDA 2019.3. Can you
inform about this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino
<gianluca.casalino@...>:
Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED
is added or removed from obj.states, but I do not know how to
acomplish that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I











Noelia Ruiz
 

Thanks. If you want to provide a prerelease compatible with NVDA 2019.-3 I will share on the mentioned spanish mailing list for the user that needs it.

Enviado desde mi iPhone

El 7 abr 2020, a las 11:34, Gianluca Casalino <gianluca.casalino@...> escribió:

Hi,
if it is urgent I can provide a pre-release. All is working fine.
There are actually these little issues that there was already in the past :

1- Now the midi window as all others (for instance the part window) is correctly handled. There is only two controls for which I have to investigate.
2- the Braille when route cursor does not invoke probably all events and so the midi note is not played (jaws does it. When you route the cursor it works as you move phisically the caret).
I do not know how to acomplish this.

3- the most important is that I can not handle the review cursor.
TO work Ishould always retrive the characer coordinates on the screen (points).
Unfortunately when I use getPointFromoffset and similar functions I get always an error.
The last is that there is a listbox handled a little bit bad. It is focused but are not spoken the number of elements and the current number of focused element.
I do not know how to fix this.
Anyway the addon makes all things (even better) it did in the past and makes alot of new things.


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:47
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thank you. When you have a download to link the addon file, let us know and I will inform to the spanish user. He cannot update NVDA since he needs thisadd-on.
If we can help with GitHub don"t esitate to ask. Ciao Enviado desde mi iPhone

El 7 abr 2020, a las 9:17, Gianluca Casalino <gianluca.casalino@...> escribió:

Yes. I could be considered ready. I have to perform some cosmetic improvements and prepare some little documentation.
I have never pubblished works on github, but probably this addon is very important and I should spend some time to put it there.
Thanks you again

-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io
<nvda-addons@nvda-addons.groups.io> Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 09:11
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Thanks, I see you have fixed it. Please let us know when this can be used with NVDA 2019.3.
Kind regards

2020-04-07 8:03 GMT+02:00, Gianluca Casalino <gianluca.casalino@...>:
I tried it and for example if you try:

import speech


class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
speech.speakText("I want to kill covid19") even if I check :
if obj.role == controltypes.ROLE_CHECKBOX



you will hear twice this message


-----Messaggio originale-----
Da: nvda-addons@nvda-addons.groups.io
<nvda-addons@nvda-addons.groups.io>
Per conto di Noelia Ruiz
Inviato: martedì 7 aprile 2020 07:39
A: nvda-addons@nvda-addons.groups.io
Oggetto: Re: [nvda-addons] trouble with events

Hello, as a uggestion (not tested), have you tried to use the event
at appModule level, with and without calling nextHandler?

class AppModule(appModuleHandler.AppModule):

def event_stateChange(self, obj, nextHandler):
...

https://www.nvaccess.org/files/nvda/documentation/developerGuide.html

Also, a person on my spanish mailing list for NVDA is asking if your
add-on for BME is updated to be compatible with NVDA 2019.3. Can you
inform about this?
Thanks

2020-04-06 20:53 GMT+02:00, Gianluca Casalino
<gianluca.casalino@...>:
Hi,

the class is as follows:
class myclass(Iaccessible):
....

and I use it in chooseNVDAOverlayClasses when the role is ROLE_CHECKBOX.
I would make a condition that check if controltypes.STaTE_CHECKED
is added or removed from obj.states, but I do not know how to
acomplish that..
If were exist controltypes.STaTE_UNCHECKed it would be easy:

if controltypes.STATE_CHECKED is in self|states or
controltypes.STATE_UNCHECKED is in self.states.

Anyway when the control is unselected when stateChange is call there
are multiple reasons.

Inviato da iPhone

Il giorno 6 apr 2020, alle ore 18:53, Joseph Lee
<@joslee> ha scritto:

I