Is it possible to hack the "rotate" key?
Paul Fox
pgf at laptop.org
Mon Feb 18 09:28:36 EST 2013
ajay wrote:
> Thanks Gary and Paul.
> I tested "Moon" on build 28 on XO-4; and the rotation caused the canvas to
> be redrawn appropriately.
>
okay. was that unexpected?
>
> Paul,
>
> I have two queries ::
>
> a)
> In "Moon"'s code (as already told by Gary), the "size-changed" signal is
> used to call the callback that redraws the canvas.
> So, in this case, is the "size-changed" signal a result of the
> rotate-key-event (KEY_SWITCHVIDEOMODE), or "size-changed" signal is
> generated via some another mechanism?
i don't know.
>
> b)
> Is the behaviour of olpc-kbdshim the same for a XO-1.75 and a XO-4 (as far
> as "that code is written to either run a command
> attached to the event (currently /usr/bin/olpc-rotate), or pass the event
> through, but not both" is concerned)?
yes. and for XO-1 and XO-1.5 as well.
paul
>
>
>
>
> On Mon, Feb 18, 2013 at 7:18 PM, Paul Fox <pgf at laptop.org> wrote:
>
> > ajay wrote:
> > > Hi all.
> > >
> > > Is it possible to hack the "rotate" key in XO?
> > >
> > > I wish to have the following working ::
> > >
> > > * Press the "rotate" key. This will rotate the window.
> > > * Just after that, have a callback function being called in "sugar"
> > > (this of course being possible only if the "rotate" key could be
> > hacked).
> > >
> >
> > as gary points out, the rotate key event (KEY_SWITCHVIDEOMODE) is
> > caught by olpc-kbdshim. that code is written to either run a command
> > attached to the event (currently /usr/bin/olpc-rotate), or pass the
> > event through, but not both.
> >
> > if there were consensus that running the command _and_ passing the
> > event was safe and reasonable, maybe we could do that, though it
> > doesn't feel right to me.
> >
> > but i also think gary's on the right track by suggesting you look at
> > other window events to learn of the rotation changes -- after all,
> > rotation doesn't require a button press. it can be caused by manual
> > xrandr invocation, or simply by someone typing "olpc-rotate left".
> >
> > paul
> >
> > >
> > >
> > > I will be thankful for any pointers.
> > >
> > >
> > >
> > > Regards,
> > >
> > > Ajay Garg
> > > Dextrose Developer
> > > Activity Central: http://activitycentral.com
> > > part 2 text/plain 129
> > > _______________________________________________
> > > Devel mailing list
> > > Devel at lists.laptop.org
> > > http://lists.laptop.org/listinfo/devel
> >
> > =---------------------
> > paul fox, pgf at laptop.org
> > _______________________________________________
> > Devel mailing list
> > Devel at lists.laptop.org
> > http://lists.laptop.org/listinfo/devel
> >
>
>
>
> --
> Regards,
>
> Ajay Garg
> Dextrose Developer
> Activity Central: http://activitycentral.com
=---------------------
paul fox, pgf at laptop.org
More information about the Devel
mailing list