hi,I have met some problems with mouse:b1p event

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

hi,I have met some problems with mouse:b1p event

areslp
I want to catch the mouse click event,but with the code below,I got
nothing.Am I using the at-spi in the wrong way?Anyone can give me some
suggestions?
Thanks!

#include "firefox.h"

void cb(const AccessibleEvent *event,void *user_data)
{
        Accessible *source=event->source;
        char *name=Accessible_getName(source);
        char *roleName=Accessible_getRoleName(source);
        printf("Get focus:%s'%s\n",roleName,name);
        SPI_freeString(name);
        SPI_freeString(roleName);
}

void cb1(const AccessibleEvent *event,void *user_data)
{
        printf("b1p!\n");
}

int main()
{
        SPI_init ();
        AccessibleEventListener *listener = SPI_createAccessibleEventListener
(cb, NULL);
        AccessibleEventListener *listener1 =
SPI_createAccessibleEventListener (cb1, NULL);
        SPI_registerGlobalEventListener (listener,"focus:");
        SPI_registerGlobalEventListener (listener1,"mouse:b1p");
        SPI_event_main ();
        return 0;
}
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: hi,I have met some problems with mouse:b1p event

Steve Lee-3
2008/5/14 areslp <[hidden email]>:
> I want to catch the mouse click event,but with the code below,I got
>  nothing.Am I using the at-spi in the wrong way?Anyone can give me some
>  suggestions?
>  Thanks!

Does the focus work?
The code looks reasonable to me but I'm not familiar with the C
binding. Have you checked the GOK source?

I highly recommend you consider using Python and pyatspi, you'll save
yourself a lot of low-level work and pain.

One general point is do as little as possible in the callbacks. You'll
run into problems with printing and other slow actions. The best
approach is to make processing asynchronous by queueing the event
information and processing in your app's main loop or idle time.

--
Steve Lee
--
Open Source Assistive Technology Software
web: fullmeasure.co.uk
blog: eduspaces.net/stevelee/weblog
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: hi,I have met some problems with mouse:b1p event

Nagappan
In reply to this post by areslp
Hello,

As per my experience with at-cspi, only this
"Gtk:GtkWidget:button-press-event" gives appropriate event.

http://webcvs.freedesktop.org/ldtp/ldtp/src/ldtp-record.c?content-type=text%2Fplain&view=co

Note: at-cspi is not updated as pyatspi. So, I recommend to go with pyatspi.

Thanks
Nagappan

On Tue, May 13, 2008 at 10:48 PM, areslp <[hidden email]> wrote:

> I want to catch the mouse click event,but with the code below,I got
> nothing.Am I using the at-spi in the wrong way?Anyone can give me some
> suggestions?
> Thanks!
>
> #include "firefox.h"
>
> void cb(const AccessibleEvent *event,void *user_data)
> {
>        Accessible *source=event->source;
>        char *name=Accessible_getName(source);
>        char *roleName=Accessible_getRoleName(source);
>        printf("Get focus:%s'%s\n",roleName,name);
>        SPI_freeString(name);
>        SPI_freeString(roleName);
> }
>
> void cb1(const AccessibleEvent *event,void *user_data)
> {
>        printf("b1p!\n");
> }
>
> int main()
> {
>        SPI_init ();
>        AccessibleEventListener *listener =
> SPI_createAccessibleEventListener
> (cb, NULL);
>        AccessibleEventListener *listener1 =
> SPI_createAccessibleEventListener (cb1, NULL);
>        SPI_registerGlobalEventListener (listener,"focus:");
>        SPI_registerGlobalEventListener (listener1,"mouse:b1p");
>        SPI_event_main ();
>        return 0;
> }
> _______________________________________________
> dev-accessibility mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-accessibility
>



--
Linux Desktop (GUI Application) Testing Project -
http://ldtp.freedesktop.org
http://nagappanal.blogspot.com
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: hi,I have met some problems with mouse:b1p event

Steve Lee-3
I understand cspi is now depreciated.

On 14/05/2008, Nagappan A <[hidden email]> wrote:

> Hello,
>
>  As per my experience with at-cspi, only this
>  "Gtk:GtkWidget:button-press-event" gives appropriate event.
>
>  http://webcvs.freedesktop.org/ldtp/ldtp/src/ldtp-record.c?content-type=text%2Fplain&view=co
>
>  Note: at-cspi is not updated as pyatspi. So, I recommend to go with pyatspi.
>
>  Thanks
>  Nagappan
>
>
>  On Tue, May 13, 2008 at 10:48 PM, areslp <[hidden email]> wrote:
>
>  > I want to catch the mouse click event,but with the code below,I got
>  > nothing.Am I using the at-spi in the wrong way?Anyone can give me some
>  > suggestions?
>  > Thanks!
>  >
>  > #include "firefox.h"
>  >
>  > void cb(const AccessibleEvent *event,void *user_data)
>  > {
>  >        Accessible *source=event->source;
>  >        char *name=Accessible_getName(source);
>  >        char *roleName=Accessible_getRoleName(source);
>  >        printf("Get focus:%s'%s\n",roleName,name);
>  >        SPI_freeString(name);
>  >        SPI_freeString(roleName);
>  > }
>  >
>  > void cb1(const AccessibleEvent *event,void *user_data)
>  > {
>  >        printf("b1p!\n");
>  > }
>  >
>  > int main()
>  > {
>  >        SPI_init ();
>  >        AccessibleEventListener *listener =
>  > SPI_createAccessibleEventListener
>  > (cb, NULL);
>  >        AccessibleEventListener *listener1 =
>  > SPI_createAccessibleEventListener (cb1, NULL);
>  >        SPI_registerGlobalEventListener (listener,"focus:");
>  >        SPI_registerGlobalEventListener (listener1,"mouse:b1p");
>  >        SPI_event_main ();
>  >        return 0;
>  > }
>  > _______________________________________________
>  > dev-accessibility mailing list
>  > [hidden email]
>  > https://lists.mozilla.org/listinfo/dev-accessibility
>  >
>
>
>
>
> --
>  Linux Desktop (GUI Application) Testing Project -
>  http://ldtp.freedesktop.org
>  http://nagappanal.blogspot.com
>
> _______________________________________________
>  dev-accessibility mailing list
>  [hidden email]
>  https://lists.mozilla.org/listinfo/dev-accessibility
>


--
Steve Lee
--
Open Source Assistive Technology Software
web: fullmeasure.co.uk
blog: eduspaces.net/stevelee/weblog
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: hi,I have met some problems with mouse:b1p event

areslp
In reply to this post by Nagappan
On May 14, 10:49 pm, "Steve Lee" <[hidden email]> wrote:

> I understand cspi is now depreciated.
>
> On 14/05/2008, Nagappan A <[hidden email]> wrote:
>
>
>
> > Hello,
>
> >  As per my experience with at-cspi, only this
> >  "Gtk:GtkWidget:button-press-event" gives appropriate event.
>
> >  http://webcvs.freedesktop.org/ldtp/ldtp/src/ldtp-record.c?content-typ...
>
> >  Note: at-cspi is not updated as pyatspi. So, I recommend to go with pyatspi.
>
> >  Thanks
> >  Nagappan
>
> >  On Tue, May 13, 2008 at 10:48 PM, areslp <[hidden email]> wrote:
>
> >  > I want to catch the mouse click event,but with the code below,I got
> >  > nothing.Am I using the at-spi in the wrong way?Anyone can give me some
> >  > suggestions?
> >  > Thanks!
>
> >  > #include "firefox.h"
>
> >  > void cb(const AccessibleEvent *event,void *user_data)
> >  > {
> >  >        Accessible *source=event->source;
> >  >        char *name=Accessible_getName(source);
> >  >        char *roleName=Accessible_getRoleName(source);
> >  >        printf("Get focus:%s'%s\n",roleName,name);
> >  >        SPI_freeString(name);
> >  >        SPI_freeString(roleName);
> >  > }
>
> >  > void cb1(const AccessibleEvent *event,void *user_data)
> >  > {
> >  >        printf("b1p!\n");
> >  > }
>
> >  > int main()
> >  > {
> >  >        SPI_init ();
> >  >        AccessibleEventListener *listener =
> >  > SPI_createAccessibleEventListener
> >  > (cb, NULL);
> >  >        AccessibleEventListener *listener1 =
> >  > SPI_createAccessibleEventListener (cb1, NULL);
> >  >        SPI_registerGlobalEventListener (listener,"focus:");
> >  >        SPI_registerGlobalEventListener (listener1,"mouse:b1p");
> >  >        SPI_event_main ();
> >  >        return 0;
> >  > }
> >  > _______________________________________________
> >  > dev-accessibility mailing list
> >  > [hidden email]
> >  >https://lists.mozilla.org/listinfo/dev-accessibility
>
> > --
> >  Linux Desktop (GUI Application) Testing Project -
> >  http://ldtp.freedesktop.org
> >  http://nagappanal.blogspot.com
>
> > _______________________________________________
> >  dev-accessibility mailing list
> >  [hidden email]
> >  https://lists.mozilla.org/listinfo/dev-accessibility
>
> --
> Steve Lee
> --
> Open Source Assistive Technology Software
> web: fullmeasure.co.uk
> blog: eduspaces.net/stevelee/weblog

Thanks,I have do some research on pyatspi,but I cant find the entire
api doc.
I found one at http://www.gnome.org/~parente/pyatspi/doc/,but I dont
think it's a full version.Like the code below:
panel.queryComponent().getPosition(0)

queryComponent function and getPosition function can not be found in
the api doc.
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility
Reply | Threaded
Open this post in threaded view
|

Re: hi,I have met some problems with mouse:b1p event

areslp
In reply to this post by areslp
On May 14, 10:44 pm, "Nagappan A" <[hidden email]> wrote:

> Hello,
>
> As per my experience with at-cspi, only this
> "Gtk:GtkWidget:button-press-event" gives appropriate event.
>
> http://webcvs.freedesktop.org/ldtp/ldtp/src/ldtp-record.c?content-typ...
>
> Note: at-cspi is not updated as pyatspi. So, I recommend to go with pyatspi.
>
> Thanks
> Nagappan
>
>
>
> On Tue, May 13, 2008 at 10:48 PM, areslp <[hidden email]> wrote:
> > I want to catch the mouse click event,but with the code below,I got
> > nothing.Am I using the at-spi in the wrong way?Anyone can give me some
> > suggestions?
> > Thanks!
>
> > #include "firefox.h"
>
> > void cb(const AccessibleEvent *event,void *user_data)
> > {
> >        Accessible *source=event->source;
> >        char *name=Accessible_getName(source);
> >        char *roleName=Accessible_getRoleName(source);
> >        printf("Get focus:%s'%s\n",roleName,name);
> >        SPI_freeString(name);
> >        SPI_freeString(roleName);
> > }
>
> > void cb1(const AccessibleEvent *event,void *user_data)
> > {
> >        printf("b1p!\n");
> > }
>
> > int main()
> > {
> >        SPI_init ();
> >        AccessibleEventListener *listener =
> > SPI_createAccessibleEventListener
> > (cb, NULL);
> >        AccessibleEventListener *listener1 =
> > SPI_createAccessibleEventListener (cb1, NULL);
> >        SPI_registerGlobalEventListener (listener,"focus:");
> >        SPI_registerGlobalEventListener (listener1,"mouse:b1p");
> >        SPI_event_main ();
> >        return 0;
> > }
> > _______________________________________________
> > dev-accessibility mailing list
> > [hidden email]
> >https://lists.mozilla.org/listinfo/dev-accessibility
>
> --
> Linux Desktop (GUI Application) Testing Project -http://ldtp.freedesktop.orghttp://nagappanal.blogspot.com

Thanks for reply.Yes,this event works...but the the source Accessible
object get from AccessibleEvent,always point to a panel widget in
firefox,it works good in gedit.Meanwhile,the focus event can get the
right widget...
_______________________________________________
dev-accessibility mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-accessibility