Author Topic: Getting the Brightness Buttons to work. (Fn3/Fn4)  (Read 1788 times)

jgraves

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« on: April 12, 2004, 11:29:22 am »
All,

I\'ve had this working for awhile.  It wasn\'t too hard to do.  I had to
download and build xkeymouse:
http://xkeymouse.sourceforge.net/
and start it up in my /home/root/.xinitrc
/usr/local/bin/xkeymouse&

Then I added two lines to my /etc/xkmc
keycode=51, Mod2Mask, Exec, /usr/local/bin/downLight, NoFork, NoAutoRepeat
keycode=52, Mod2Mask, Exec, /usr/local/bin/upLight, NoFork, NoAutoRepeat

Mod2Mask is the purple Fn key.  Keycode 51 is \'3\' and 52 is \'4\'
The only other thing you need is my downLight and upLight scripts!

They are simple scripts that manipulate your $HOME/Choices/common/backlight file then run setfl on it.

Here they are:
downLight:
-------------------------------------
#!/bin/sh

# Get the current value
CURRENT_VALUE=`cat $HOME/Choices/common/backlight`
MIN_VALUE=0

#If it is not already at the min, decrement it one and save it.
if [ $CURRENT_VALUE = $MIN_VALUE ]; then
NEW_VALUE=$(($CURRENT_VALUE))
else
NEW_VALUE=$(($CURRENT_VALUE-1))
fi

setfl $NEW_VALUE
echo $NEW_VALUE ] $HOME/Choices/common/backlight
-------------------------------------

upLight
-------------------------------------
#!/bin/sh

# Get the current value
CURRENT_VALUE=`cat $HOME/Choices/common/backlight`
MAX_VALUE=6

#If it is not already at the max value, increment it one.
if [ $CURRENT_VALUE = $MAX_VALUE ]; then
NEW_VALUE=$(($CURRENT_VALUE))
else
NEW_VALUE=$(($CURRENT_VALUE+1))
fi

setfl $NEW_VALUE
echo $NEW_VALUE ] $HOME/Choices/common/backlight
-------------------------------------

DnK

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #1 on: April 12, 2004, 01:07:59 pm »
Just tryed it... doesn\'t work with my setup.... the scripts alone works perfect... xkeymouse compiles & starts perfectly... Fn+3 - Fn+4 does\'t work at all... don\'t know what\'s the matter...

Foxdie

  • Sr. Member
  • ****
  • Posts: 465
    • View Profile
    • http://trackmygps.co.uk
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #2 on: April 12, 2004, 01:22:43 pm »
I wrote a script just like this about 2 months ago for the Cacko team, as well as other shortcut scripts. The problem is they haven\'t reverted the latest ROMS back to an old xmodmap version so it won\'t work until they do.
Jason "Foxdie" Gaunt
HTC Universal G4 with 2GB SD card running Debian Titchy Linux
[img]http://trackmygps.co.uk/signatures/foxdie.gif\" border=\"0\" class=\"linked-sig-image\" /]
Click image to view my GPS tracker
Follow me on Twitter: @jasongaunt

jgraves

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #3 on: April 12, 2004, 01:51:56 pm »
Try running the xkeymouse manually with the --verbose option.  see what it says.
It should dump out the settings for the two keys.  Then press the keys.  It should
tell you that it is running the scripts.

DnK

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #4 on: April 13, 2004, 08:47:47 am »
I think the prob is that somehow i messed up my xmodmap file... the fn kee doesn\'t work at all... don\'t know how i did it.. could someone please send an original file to me?

zxerx

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #5 on: April 14, 2004, 08:59:44 am »
Quote
I think the prob is that somehow i messed up my xmodmap file... the fn kee doesn\'t work at all... don\'t know how i did it.. could someone please send an original file to me?

the primary reason I started investigating xmodmap was because my fn keys gave me nothing with a default pdaXrom install when running the ion window manager. Even after I customised /etc/X11/xinit/.Xmodmap (which is a link to /etc/X11/kb/corgi.xmodmap) to my liking, I found I still had to call `xmodmap <myxmodmapfile>` directly to make things work. Now I just call xmodmap directly when starting X.

Foxdie has a few xmodmap files floating around which I found helpful:

http://foxdie.timduru.org/zaurus/corgi.xmodmap
http://foxdie.timduru.org/zaurus/corgi.xmodmap.bak
http://foxdie.timduru.org/zaurus/x11_stuff...f/corgi.xmodmap

Unfortunately, attachments don\'t seem to be working on this server, so I\'ve taken the liberty of displaying my personal xmodmap file below:


!
! keyboard setup for Zaurus SL-Cxx0
!

clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5


!
! Set up the extra keycodes for \'fn-able\' keys
! <none> <Shift> <Mode_Switch> <Shift+Mode_Switch>
!
keycode 49 = 1 exclam F1
keycode 50 = 2 quotedbl F2
keycode 51 = 3 numbersign F3
keycode 52 = 4 dollar F4
keycode 53 = 5 percent F5
keycode 54 = 6 ampersand F6
keycode 55 = 7 quoteright F7
keycode 56 = 8 parenleft F8
keycode 57 = 9 parenright F9
keycode 58 = 0 asciitilde F10
keycode 39 = BackSpace BackSpace Delete Delete

keycode 25 = q Q
keycode 31 = w W asciicircum asciicircum
keycode 13 = e E equal equal
keycode 26 = r R plus plus
keycode 28 = t T bracketleft bracketleft
keycode 33 = y Y bracketright bracketright
keycode 29 = u U braceleft braceleft
keycode 17 = i I braceright braceright
keycode 23 = o O
keycode 24 = p P

keycode 73  = Tab Tab Caps_Lock Caps_Lock
keycode 9  = a A
keycode 27 = s S
keycode 12 = d D aring periodcentered
keycode 14 = f F backslash backslash
keycode 15 = g G semicolon semicolon
keycode 16 = h H colon colon
keycode 18 = j J asterisk asterisk
keycode 19 = k K
keycode 20 = l L bar bar

keycode 34 = z Z
keycode 32 = x X XF86Cut
keycode 11 = c C XF86Copy
keycode 30 = v V XF86Paste
keycode 10 = b B underscore underscore
keycode 22 = n N
keycode 21 = m M

keycode 66 = minus minus at at
keycode 71 = slash comma less quoteleft
keycode 72 = period question greater greater

! side buttons

keycode 117 = XF86PowerDown
keycode 134 = Left
keycode 133 = Right
keycode 131 = Return
keycode 132 = Escape

! Cursor Keys

keycode 43 = Left Left Home
keycode 44 = Up Up Prior
keycode 45 = Down Down Next
keycode 46 = Right Right End

! This is the screen swivel sensor - think of a better keysym !

keycode 110 = Sys_Req



!
! Modifier keycodes
!

! The \'Fn\' button
keycode 38  = Mode_switch

! Left japanese button
keycode 129 = Control_L

! Right japanese button
keycode 130 = Alt_L

! Calendar button
keycode 96 = Control_L

! Address button
keycode 97 = Alt_L

! Mail button
keycode 98 =

! Home button
keycode 48 =

! Menu button
keycode 37 = Control_R

! Left Shift Button
keycode 35  = Shift_L

! Right Shift Button
keycode 111 = Shift_R


!
! Setup up what our modifier keys do
!
add shift   = Shift_L Shift_R
add lock    = Caps_Lock
add control = Control_L Control_R
add mod1    = Alt_L Alt_R
add mod2    = Mode_switch
!add mod3    =
!add mod4    =
!add mod5    =
[span style=\'font-size:7pt;line-height:100%\']Zaurus SL-C760 :: pdaXrom 1.0.5 :: Toshiba 512Mb SD :: Hagiwara 256Mb 10Mbit/s SD :: PQI 256Mb 40x CF :: Socket Low Power 10Mb/s Ethernet CF :: Seano WiFi CF :: Xircom 56k Modem CF[/span]

DnK

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • http://
Getting the Brightness Buttons to work. (Fn3/Fn4)
« Reply #6 on: April 14, 2004, 09:06:17 am »
thanx, zxerx.

hope it\'ll help.