[Urwid] mouse_event to keypress

Angel Kolev meneldor at gmail.com
Fri Feb 15 11:08:53 EST 2013


Sorry i meant urwid.Edit. I wrapped it as:
>
> class BaseInput(urwid.Edit):
>       super(BaseInput, self).__init__(.....


So i want to initiate a keypress trough a mouse_event. Something like:
self.__super.keypress(size,"down")

On Fri, Feb 15, 2013 at 5:52 PM, Ian Ward <ian at excess.org> wrote:

> On Fri, Feb 15, 2013 at 10:45 AM, Angel Kolev <meneldor at gmail.com> wrote:
> > Hello group,
> >
> > I have class which wraps EditBox. I want to initiate "Up" or "Down" key
> > presses using the mouse event buttons 4 and 5 so when i scroll the mouse
> > over the EditBox it should act the same way i am using the keyboard.
> > I tried this:
> >
> >>     def mouse_event(self,size,event,button,col,row,focus):
> >>         if int(button)==5:
> >>             self.__super.keypress(size,"down")
> >>         elif int(button)==4:
> >>             self.__super.keypress(size,"up")
> >
> > The goal i want to achieve is to scroll over ListBox items where every
> line
> > is an EditBox. It works perfectly with up/down from the keyboard but cant
> > using the method above.
>
> Hello.  I'm not sure what EditBox is.
>
> Would you post a complete runnable example of what you're trying to do?
>
> Ian
>
> _______________________________________________
> Urwid mailing list
> Urwid at lists.excess.org
> http://lists.excess.org/mailman/listinfo/urwid
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130215/f9ca4fb2/attachment.htm 


More information about the Urwid mailing list