Results 1 to 10 of 378

Thread: Asus T91 linux installation

Threaded View

  1. #19
    Join Date
    Nov 2008
    Location
    Southern Ontario, Canada
    Beans
    296
    Distro
    Ubuntu UNR

    Re: Asus T91 linux installation

    Quote Originally Posted by Roman Shuvalov View Post
    Hi,
    I want to use "rotate button" to make right-click of mouse. I read how you catch ACPI events of pressing/releasing this button, but how to write the script that turns on left-handed mouse orientation? can you help me?

    By the way, there are 2 events on transformation netbook to tablet mode and backwards transformation (this events are used on M$ Windows for decreasing processor's frequency to 800 MHz - maybe because of problems with cooling).
    Code:
    > acpi_listen
    hotkey ATKD 0000007e 00000002 /* transform to tablet */
    hotkey ATKD 0000007f 00000002 /* transform to normal notebook */
    I recommend attach whis events to 180-degree screen rotation - when you transform netbook to tablet you ALWAYS need to rotate the screen and this rotation can be easily automated by this events.
    Roman, this is what I use to rotate the screen...
    Code:
    $ more /etc/acpi/events/asus-rotate-t91 
    
    event=hotkey (ATKD|HOTK) 0000007b
    action=/etc/acpi/rotatescreen.sh
    
    $ more /etc/acpi/rotatescreen.sh
    
    #!/bin/sh
    #
    # This script rotates the display in TabletPCs when screen is changed from
    # laptop to tablet mode, or when rotation button is pressed
    
    test -f /usr/share/acpi-support/key-constants || exit 0
    
    . /usr/share/acpi-support/power-funcs
    
    if [ -f /var/lib/acpi-support/screen-rotation ] ; then
      ROTATION=`cat /var/lib/acpi-support/screen-rotation`
    fi
    
    case "$ROTATION" in
    	right)
    	NEW_ROTATION="normal"
    	;;
    	*)
    	NEW_ROTATION="right"
    	;;
    esac
    
    for x in /tmp/.X11-unix/*; do
    	displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
    	getXconsole;
    	if [ x"$XAUTHORITY" != x"" ]; then
    	    export DISPLAY=":$displaynum"           
    	    /usr/bin/xrandr -o $NEW_ROTATION && echo $NEW_ROTATION > /var/lib/acpi-support/screen-rotation
    	fi
    done
    You could hack the /etc/scpi/rotatescreen.sh line to another script and then use the acpi_fakekey command to possibly do the right-click. I'd check other scripts in /etc/acpi for examples, man pages etc.
    Hope that helps!

    EDIT: a great tool to find acpi key values is 'acpi_listen'
    Last edited by kgingeri; March 10th, 2010 at 01:24 AM. Reason: corrections

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •