[ltp] Thinkpad X300 brightness keys through window manager (Debian Lenny)

Norman Ramsey linux-thinkpad@linux-thinkpad.org
Fri, 13 Feb 2009 18:00:26 -0500


 > On Fri, Oct 10, 2008 at 19:42:13 -0400, Norman Ramsey wrote:
 > 
 > >   * tpb brightness buttons do not work: they change the OSD, but
 > >     not the backlight.  I'm using xbacklight on the command line,
 > >     which works perfectly, but I would really like to figure out how
 > >     to program those buttons to (say) xbacklight -dec 10 and so on.
 > 
 > On my X61s, thinkpad-acpi is able to send input events for the
 > brightness keys, so that you can bind those keys to the corresponding
 > xbacklight command in you desktop environment/window manager.
 > 
 > You can check if such input events are sent by running xev and pressing
 > those keys. Then, bind these event codes to a proper key binding using
 > xmodmap. The ~/.Xmodmap on my X61s is configured like this:
 > 
 > keycode 101 = XF86MonBrightnessDown
 > keycode 212 = XF86KbdBrightnessUp

This works exactly as you described, down to the keycodes.
But there is a strangeness---there is a delay of almost half a second.
I'm using 

  xbacklight -time 0 -steps 1 -dec 10

On the command line the delay is about 200 ms, which is still
annoying.

For those who may be interested, DON'T try using a tpb callback to
call xbacklight on brightness events.  Apparently xbacklight does
something which the tpb daemon interprets as button presses, with the
result that it goes into runaway brightness changing.


Norman