shiftbuttons: HTC Shift Hardware Buttons control

shiftbuttons is a program that monitors the two right side hardware buttons on HTC shift, and launches any desired program when a button is pressed.

Typical usage is to start it as daemon (-d option) when you start your X session, and map each button to the desired function. For example, you can go into Gnome menu System -> Settings -> Sessions. There you find a tab named ‘Startup Programs’, and add the following:

    shiftbuttons -d -c \"gksudo /usr/bin/hsect2\" -r htcshift-rotate

This will launch hsect2 when you press the CommManager button, and will rotate the screen when you press the switch resolution button.

System wide configuration can be changed at /etc/xdg/autostart/shiftbuttons.desktop.

htcshift-rotate is also included in the tarball and the debian package.


Source code: shiftbuttons-1.0.tar.gz
Ubuntu / Debian package: shiftbuttons_1.0-1_i386.deb

This entry was posted in linux. Bookmark the permalink.

9 Responses to shiftbuttons: HTC Shift Hardware Buttons control

  1. ferrett1968 says:

    It’s amazing!!!!
    I use KDE but when I run the exec the mdg is:
    Can’t access shared memory area. SHMConfig disabled?

    any suggest?


  2. ferrett1968 says:

    just added

    Option “SHMConfig” in xorg.conf

    thanks POF

  3. Snorry says:


    The rotate screen gives me a rotation to the right but my screen gets divided.
    Looking at your script and reading your comments on xda-developer is saw you use the command xrandr.

    Reading the help file for xrandr is saw it is possible to also give the possible size for the screen.
    But xorg.conf needs to be adjusted for that. Using the easy setup way I saw you copied the xorg.cof and added a new one. If I adjust my xorg.conf to allow the resolution 600×800 won’t it be overwritten when I swicth between kernel and synce?

    Also I would be in trouble since the easy setup uses the .deb package which doesn’t include the alterations in htschift-rotate.c

    Rotation to the right could be:
    xrandr -o right -s 600×800

    Default could be:
    xrandr -0 0 -s800x600

    Is my reasoning correct?

  4. Snorry says:

    Oops should be 480×800 and 800×480

  5. pof says:

    @ferrett1968: yes, it’s on the README 😉

    @Snorry: yes your reasoning seems correct. What do you mean by “my screen gets divided”? For me it’s rotating correctly (I’m using gnome desktop + netbook-remix). What happens if you rotate it from command line?

  6. Snorry says:

    If I use the same command like in the script on the commandline.
    My screen rotates to the right. 2/3 on top is the left side of my normal screen (starting from the left). lower 1/3 is the same but starting from the right.

  7. ferrett1968 says:

    oh oh!
    or better….. doh!


  8. Jorge says:

    Yo tengo el mismo problema que Snorry. La pantalla aparece dividida y la pantalla táctil no funciona.

    I have the same problem that Snorry. The screen gets divided y lo otro no sé traducirlo.

  9. Pascal says:

    This is just what I would be looking for:

    Remapping the keys on the Shift.
    However I would need this for Windows and MacOS.
    Any chance that will work there too ?

    Any help/effort appreciated.

    And thanks for your great work.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>