Acer 1825 use special button above ESC in GNOME for activating/deactivating gyro auto rotation

By Christopher, December 13, 2010

The Acer 1825 has a special Button for recovery purpose (in windows) above the ESC Key to use this button for a arbitrary script following steps are necessary (in general it is the same procedure like shown in this post http://www.ceh-photo.de/blog/?p=200):

  1. Add
    setkeycodes e062 176

    to rc.local (e.g.

    sudo gedit /etc/rc.local

    )

  2. Reboot (or use the setkeycodes-command in terminal)
  3. gnome-keybinding-properties
  4. Add a new command and set the path of execution to your script or application you want to start with this button

If you want to start or stop my gyro-auto-rotation script (http://www.ceh-photo.de/blog/?p=186) with this button use following script:

1
2
3
4
5
6
7
8
#!/bin/bash

pid=$( pgrep gyro-auto-rotat )
if [ "$pid" == "" ] ;then
gyro-auto-rotate.run &
else
kill -9 $pid
fi

You need to store this script under some name and give it execution rights with

chmod +x scriptname

If you are interested how you could figure out the keycode of this special key, you only need to check dmesg after pressing it (Thanks to Tomfrancart from ubuntuforums.org)