[plug] Help needed - NOT - front buttons on laptop

Richard Meyer meyerri at westnet.com.au
Fri Jul 7 20:19:23 WST 2006


And- yes - I should put this up in a blog entry somewhere, but since i
asked over this list, and there are a few 6400 owners out there (yes, I
know you're hiding from the Sony owners --   :-)   )  - thought I'd post
for general edification - and since the principles are probably
universal.

=========================================== 

Well, here it comes - I got my front buttons on my Dell Inspiron 6400
working at last - whoot!!!

I'm including my previous post down below just to give background.

I don't know whether this is the _best_ solution, but it _works_.

By reading a few sites _like_ this
http://individual.utoronto.ca/jaelle_kitty/inspiron6400/ (note this site
doesn't do much about the front buttons, but ...) I got a few ideas that
I had to use Xmodmap or something like xhkeys, and since xhkeys hasn't
been updated since the Dead Sea reported sick, I decided to play with
xmodmap.

What I ended up with was the following in my ~/.Xmodmap file

> !! RMRMRM attempt to get the front keys to do something useful
> keycode 160 = XF86AudioMute
> keycode 174 = XF86AudioLowerVolume
> keycode 176 = XF86AudioRaiseVolume
> keycode 162 = F21
> keycode 144 = F22
> keycode 153 = F23
> keycode 164 = F24

Those funny numbers after the "keycode" are the scancodes for the front
keys, which are Linux readable. The "Fxx" numbers are just keys that do
not exist on my keyboard. 

REBOOT after this to get the keys set by X - maybe just restarting X
would work, it didn't for me, but I had a few things going at the time,
so .. YMMV.

The first three keys worked immediately - (mute, volumedown, volumeup) -
the rest didn't do much (yet).

So I'm mapping weird keys to a keycode which KDE may know, but it can't
be supplied by my keyboard by any other means. 

After that I went and created a "~.controls" directory and created the
following batch files
> -rwxr-xr-x 1 richard1 users 38 2006-07-07 18:51 amaroknext
> -rwxr-xr-x 1 richard1 users 44 2006-07-07 18:51 amarokpause
> -rwxr-xr-x 1 richard1 users 42 2006-07-07 18:52 amarokprev
> -rwxr-xr-x 1 richard1 users 38 2006-07-07 18:51 amarokstop
which are one-line commands to Amarok - contents below

> richard1 at Nomad:~> cat .controls/*
> #!/bin/sh
> /opt/kde3/bin/amarok --next
> #!/bin/sh
> /opt/kde3/bin/amarok --play-pause
> #!/bin/sh
> /opt/kde3/bin/amarok --previous
> #!/bin/sh
> /opt/kde3/bin/amarok --stop

Exercise for student - split following lines into 4 separate files with
names as shown previously - etc, blah ...

Now what I had was a set of scripts which would pause/unpause, skip
track, stop.  Bounce to previous track is a bit problematical - because
I am just telling Amarok to play all my music randomly, and 'previous'
doesn't seem to work really well for that - not from the front panel
mouse clicks either.

Anyway after that we get into KDE guts and esoteria - really can't
remember the steps I used to create the links between the "batch files"
and the "Fxx", which I used as shortcuts, but opened the KDE menu and
created a submenu under "multimedia, by right-clicking and going through
convulsions - mine is called "Controls".

Under the "controls" menu, I added applications - it's slightly tricky -
it just asks for a name and then creates another menu that asks for the
actual application to run and it gives you an opportunity to assign a
Shortcut-key - mouseclick on that and press the front button you wish to
assign ....

And that's it - I rebooted a time or two more because there was always
something messed up - but since you have the straight goods, you should
be fine ..  ;-)

Hope This Helps
RichardM
 

On Wed, 2006-07-05 at 19:49 +0800, Richard Meyer wrote:
> Hi all,
> 
> I've been playing with my laptop, and most things work except the front
> "dedicated audio/video control buttons".
> 
> I'm running KDE 3.5.1 under SUSE 10.1 and I've done a fair bit of
> reading as to how to get it working.
> 
> I've tried using ~/.Xmodmap to put the following lines in, and the
> uncommented lines do actually work - I get sound up and down and
> mute/unmute.
> 
> My problem is that the amarok commands don't work (and even the mute
> etc, are then left out), and the help under xmodmap is written as
> reminder from the programmer to himself, not for teaching n00bs what the
> program does.
> 
> The XF86AudioPause and such never worked, and if I read the entry of the
> person that wrote it, some of them (he doesn't state which) didn't work
> for him either.
> > !! RMRMRM attempt to get the front keys to do something useful
> > keycode 160 = XF86AudioMute
> > keycode 174 = XF86AudioLowerVolume
> > keycode 176 = XF86AudioRaiseVolume
> > ! keycode 162 = /opt/kde3/bin/amarok --play-pause
> > ! keycode 144 = /opt/kde3/bin/amarok --previous
> > ! keycode 153 = /opt/kde3/bin/amarok --next
> > ! keycode 164 = /opt/kde3/bin/amarok --stop
> > 
> > !! keycode 162 = XF86AudioPause
> > !! keycode 144 = XF86AudioPrev
> > !! keycode 153 = XF86AudioNext
> > !! keycode 164 = XF86AudioStop
> 
> I have also tried setting the keycodes to keys that don't exist on my
> keyboard - eg "F21", and then setting the shortcut (under KDE) to
> amarok, (and it works- sorta) but I can't get the shortcut to pass the
> "added parameters" - I'm really banging my head against the desk now -
> any ideas?
> 
> I have also seen references to something called xhkeys - unfortunately I
> doesn't really appear to be maintained.
> > > Front Media Buttons
> > > The volume control and play/pause/stop buttons at the front of the
> > > laptop work wonderfully with xhkeys. My ~/.XHkeys file consists of:
> > > 
> > > xhkeys.codeline7:       164;0;A*;Amarok - stop;amarok -s
> > > xhkeys.plugin1: xhkeys_cdaudio;cda;devname="/dev/cdrom";devgrab=n
> > > xhkeys.codeline2:       174;0;A*;Master Volume Down;amixer sset
> > Master 1-
> > > xhkeys.plugin2:
> > xhkeys_mixer;vol;devname="/dev/mixer"channel=-1;devgrab=n
> > > xhkeys.codeline1:       160;0;A*;Master Volume Muted;amixer -c 0 set
> > Master togglemute
> > > xhkeys.codeline6:       153;0;A*;Amarok - next;amarok -f
> > > xhkeys.codeline3:       176;0;A*;Master Volume Up;amixer sset Master
> > 1+ unmute
> > > xhkeys.codeline5:       144;0;A*;Amarok - previous;amarok -r
> > > xhkeys.codeline4:       162;0;A*;Amarok - pause;amarok --pause
> > > 
> > > This is a fairly simple configuration file, and can be tweaked
> > however
> > > you want. You can create a file from scratch using "xhkconf"
-- 
Richard Meyer <meyerri at westnet.com.au>




More information about the plug mailing list