Is it possible to hack the "rotate" key?

Gary Martin garycmartin at
Mon Feb 18 08:16:27 EST 2013

Hi Ajay,

On 18 Feb 2013, at 11:12, Ajay Garg <ajay at> 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,
> Ajay Garg
> Dextrose Developer
> Activity Central: _______________________________________________
> Devel mailing list
> Devel at

More information about the Devel mailing list