On Wed, Jul 11, 2007 at 11:21:49PM +0200, Leo wrote:

> I was wondering a similar question.
> 
> There are many keys in my laptop with "NoSymbol", for example the
> "Volume Up" key is:
> 
> KeyPress event, serial 32, synthetic NO, window 0x2000001,
>     root 0x59, subw 0x0, time 3072717986, (-333,367), root:(639,399),
>     state 0x0, keycode 176 (keysym 0x0, NoSymbol), same_screen YES,
>     XLookupString gives 0 bytes: 
>     XmbLookupString gives 0 bytes: 
>     XFilterEvent returns: False
> 
> Is it possible to bind those keys to something?

I had the same problem a few days ago. You can use xmodmap to remap as
follows. First find a keysym name to assign to these keys. Try doing

        grep -i audio /usr/share/X11/XKeysymDB

On my system this gives

        SunAudioLowerVolume     :1005FF77
        SunAudioMute            :1005FF78
        SunAudioRaiseVolume     :1005FF79
        XF86AudioLowerVolume    :1008FF11
        XF86AudioMute           :1008FF12
        XF86AudioRaiseVolume    :1008FF13
        XF86AudioPlay           :1008FF14
        XF86AudioStop           :1008FF15
        XF86AudioPrev           :1008FF16
        XF86AudioNext           :1008FF17
        XF86AudioRecord         :1008FF1C
        XF86AudioPause          :1008FF31
        XF86AudioMedia          :1008FF32
        XF86AudioRewind         :1008FF3E

Then find keycodes using Xev as you did above. Once you have them, put
the following in ~/.xmodmaprc

        ! Map function keys on laptop
        keycode 174 = XF86AudioLowerVolume
        keycode 176 = XF86AudioRaiseVolume
        keycode 160 = XF86AudioMute

(Obviously replace the keycodes I have above with the ones on your
system). Do

        xmodmap ~/.xmodmaprc

on fvwm startup. Finally, I have in my fvwm bindings

        key XF86AudioMute           A N Exec exec amixer -q set Master toggle
        key XF86AudioRaiseVolume    A N Exec exec amixer -q set Master 2+
        key XF86AudioLowerVolume    A N Exec exec amixer -q set Master 2-

The only thing I am unhappy about is that the above just increases /
decreases the volume, and gives you no confirmation or indication of
what the volume is. I wouldn't mind a volume slider, like on my TV. Xosd
has a nice volume slider, but that involves me writing a script that
gets the current volume and feeds it to xosd.

Should you, or anyone else on the list, know of a script / application
that was designed for this purpose, let me know :)

GI

-- 
'Shin' -- A device for finding furniture in the dark.

Reply via email to