Is it possible to hack the "rotate" key?
Gary Martin
garycmartin at googlemail.com
Mon Feb 18 08:16:27 EST 2013
Hi Ajay,
On 18 Feb 2013, at 11:12, Ajay Garg <ajay at activitycentral.com> 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).
>
>
>
> I will be thankful for any pointers.
This is a little out of my league, but I think you'll need to take a look at olpc-kbdshim [1] so see how things are currently triggered, in particular the olpc-rotate script. If you want to pickup aspect ration changes on the Sugar side, perhaps hook a gtk.gdk.screen_get_default().connect('size-changed', <do something interesting>) callback intp the sugar toolkit. I've implemented something simple like this in the Moon activity, so that it uses different layouts for landscape and portrait screen orientations [3].
Regards,
--Gary
[1] http://dev.laptop.org/git/users/pgf/olpc-kbdshim/
[2] http://dev.laptop.org/git/users/pgf/olpc-kbdshim/tree/olpc-rotate
[3] http://git.sugarlabs.org/moon/mainline/blobs/master/moon.py
> Regards,
>
> Ajay Garg
> Dextrose Developer
> Activity Central: http://activitycentral.com _______________________________________________
> Devel mailing list
> Devel at lists.laptop.org
> http://lists.laptop.org/listinfo/devel
More information about the Devel
mailing list