hi, with registerKeystrokeListener nor consum the key press...

1. when i key press, stop the movement but write the key too...

2. who to use with input devices ? do you have any example?

________________________________________________
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import time
import pyatspi

reg = pyatspi.Registry

class Model():
        moverse = True
        POS_X = 0

        def __init__(self):

                self.escuchar_evento()

                #debería empezar donde está el puntero en ese momento.
                self.mover_derecha(0, 100)


        def escuchar_evento(self):
                #posta: reg.registerEventListener(self.callback_evento,
'mouse:button')

reg.registerKeystrokeListener(self.callback_evento,mask=pyatspi.allModifiers(),
preemptive=True)

        def callback_evento(self, event):
                print event.type
                self.moverse=False
                return False

        def posicionar(self, x, y):
                reg.generateMouseEvent(x, y, pyatspi.MOUSE_ABS)

        def mover_derecha(self, POS_X, POS_Y):
            while POS_X <= 900 and self.moverse:
                self.posicionar(POS_X, POS_Y)
                time.sleep(0.01)
                POS_X  = POS_X + 1
                if POS_X == 889:
                    POS_X = 0

if __name__ == "__main__":
        Model()

________________________________________________






2010/3/9 Willie Walker <walker.wil...@gmail.com>

> Hi:
>
> I'm not sure exactly what you are asking (sorry :-(), but it sounds as
> though you want your application to consume the mouse button events
> rather than sending them on to the application.  The AT-SPI currently
> allows this for keyboard press/release events, but doesn't do so well
> with this for mouse button events.
>
> XEvIE may have allowed this at one time (I don't remember), but XEvIE is
> dead for all intents and purposes.  As other technologies, such as
> XInput2, are explored, consuming mouse button events may become
> possible.  In the meantime, you might be able to look at using the
> keyboard or other kinds of input devices (e.g., a joystick) to control
> your application.
>
> Will
>
> On Tue, 2010-03-09 at 14:52 -0200, Esteban Arias wrote:
> > hi,
> >
> > I nedd virtual mouse for linux.
> > For example for win exist:
> > http://centros6.pntic.mec.es/cpee.alborada/cps/raton/index.html
> >
> > I started to develop with pyatspi I move the cursor ok. but I need
> > stop the movement when the user click. I registerEventListener ok. but
> > i dont like as the click do to operating system. i like stop the
> > movement
> > without do click on the interface
> >
> > do you know if it is posible?
> >
> > thanks
> > Esteban Arias
> >
> > I attach my code example
> >
> >
> >
> >
> > _______________________________________________
> > gnome-accessibility-list mailing list
> > gnome-accessibility-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list
>
>
>
_______________________________________________
gnome-accessibility-list mailing list
gnome-accessibility-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-list

Reply via email to