Xfce audio mixer and Sun keyboard

I've installed Xfce plus the audio mixer on my FreeBSD 10.2 system. I can control the volume from the popup menu, but not from the keyboard audio mixer keys.

The keyboard is a Sun type 7 USB keyboard, which has 3 keys on the top right for audio control (on/off, volume down, volume up). The Xorg.0.log shows that this keyboard is recognized specifically when I start Xorg.

Is keyboard control of the Xfce mixer possible, and where do I look?
 
First, does those keys generate keyboard events? You can use x11/xev to find out. If the keys generate keyboard events, you can use devd(8) to trigger on those events.
See /etc/devd/asus.conf for examples (this is for Asus laptops, but the principle applies).
 
Hopefully, your sun keyboard maps the keys to XF86AudioRaiseVolume, XF86AudioLowerVolume and XF86AudioMute. Using mixer(8) you can adjust volume by a set increment, up or down, with a keypress. Muting essentially toggles the value. I think you can search the forums for examples of using the default mixer command. The $ xev command above can confirm the mapping.

I do not use Xfce4 currently but I recall a window that allowed one to set the mixer commands to a particular keypress. The Arch Linux Keyboard_volume_buttons suggests it is in keyboard shortcuts.

A word of caution, since I used Xfce4, pulseaudio has metastasized to the major desktops. If your recent install brought in pulseaudio and pulseaudio is being used, you may want to use search terms pulseaudio and XF96AudioRaiseVolume for the correct pulseaudio syntax.

Edit: More links
Sun Keyboard audio mail list archive
and
Xfce4 Website keyboard settings. Note the examples are using Alsa's amixer. FreeBSD's mixer command is mixer(8)
 
Thanks for the suggestions. xev showed me the keycodes for the audio keys, and that they didn't map to a hex code. Some work with xmodmap now has them mapping to XF86AudioRaiseVolume, XF86AudioLowerVolume and XF86AudioMute. I haven't gone beyond this yet, but a devd solution will probably work.
 
Back
Top