
Dell’s Enhanced Multimedia USB Keyboard
Last week wasn’t one of my most productive weeks. Instead of working on my thesis, I created a small utility to make it possible to use the volume knob on Dell’s Enhanced Multimedia USB Keyboard under Linux. Not because I needed it, but because it didn’t work (and my other option was writing).
Anyway, if you’d like to check out the program (it’s named knob btw), you’ll find it on my self-entitled wiki WikiErik (yeah I know, the name sucks. But that’s how far my imagination goes when it comes to names).
Update:
As some of you have noticed, WikiErik is no longer available. But the code is still available. Point your browser to git.ejohansson.se and the project dellknob.git. Or clone it by running
git clone git://git.ejohansson.se/dellknob.git
Update 2:
Added a README with the contents from WikiErik.

Great little utility, the only thing lacking is the fork to make it a daemon! I hacked the standard “Linux Daemon Writing HOWTO” on the front and created an init script for it and now have a functioning knob on boot. Let me know if you want me to contribute the code back.
Yes, it would be great if you could send me your improvements (email at the bottom of the page) so I can add it to my repository for others to take advantage of.
Glad you found it useful.
This is just what I’ve been looking for, thanks! I’m curious if you know why the knob doesn’t work under the xkb keyboard definitions…every other key on this keyboard can be mapped. One other thing, do you find that if you turn the volume knob very slowly it doesn’t change the volume? And if I “cat -A /dev/input/event4″ (with or without knob running), the amount of data displayed for each click of the knob is very inconsistent, leading me to believe either my kb is messed up or it isn’t being polled at a regular interval.
Wonderful little utility. I’ve set xbindkeys-config to map the volume down control to
amixer set 'Master' 3-and volume up similarly. I noticed paul’s suggestion, and worked up a quick script / default config using the Debian skeleton script. here’s /etc/default/dellknob:# dell knob controller default configuration file
#
# See /proc/bus/input/devices to find which devices (Handlers) to use.
# KEYBOARD is the device for your keyboard's standard keys.
# MULTIMEDIA is the device for your keyboard's multimedia keys.
#
# Running "cat KEYBOARD" should give output when you press the space bar.
# Running "cat MULTIMEDIA" should give output when turn the volume knob.
KEYBOARD="/dev/input/event1"
MULTIMEDIA="/dev/input/event2"
DAEMON_ARGS="$KEYBOARD $MULTIMEDIA"
and a diff file for /etc/init.d/dellknob:
--- skeleton 2006-09-13 09:42:03.000000000 +1200
+++ dellknob 2006-10-20 16:43:35.000000000 +1300
@@ -1,16 +1,16 @@
#! /bin/sh
### BEGIN INIT INFO
-# Provides: skeleton
+# Provides: dellknob
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
-# Description: This file should be used to construct scripts to be
-# placed in /etc/init.d.
+# Description: Daemon file to run Erik Johansson's dell volume
+# control knob script.
### END INIT INFO
-# Author: Foo Bar
+# Author: gringer
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.
@@ -19,10 +19,10 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Description of the service"
-NAME=daemonexecutablename
+DESC="Sends keyboard events when volume control wheel is moved"
+NAME=dellknob
DAEMON=/usr/sbin/$NAME
-DAEMON_ARGS="--options args"
+DAEMON_ARGS="/dev/input/event1 /dev/input/event2"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
@@ -48,9 +48,9 @@
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+ start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
@@ -68,7 +68,7 @@
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --quiet --retry=TERM/3/KILL/3 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
@@ -77,7 +77,7 @@
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ start-stop-daemon --stop --quiet --oknodo --retry=0/3/KILL/3 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
Allen:
The knob is a joystick device, that’s why it doesn’t generate any keyboard events. And yes, it’s not very precise. I’ve never tried it in Windows, but it might be interesting to know how it behaves there.
David:
Thanks! I’ve added it to my svn repository.
Hi Erik,
many thanks for your useful app. I’m just doing my switch Debian after many years of stable work with Windows. And of course there are so many things about the look and feel in this new environment that are strange to me. A lot of stuff was just working und Windows whitout me knowing why.
Your knob allowed me to eliminate one of these misfits.
MfG, Sven
Erik, thanks for writing this, it was very helpful in getting the volume to work.
In response to Allen’s comment above, I noticed that once I turn the knob in one direction it will not output anymore events in that direction until I reverse direction. But depending on how fast I turn the knob, I can increase a lot or little.
Thanks,
Rick
Hi
I’ve used this keyboard in XP and the volume knob is MUCH more precise than when running under ‘knob’ in linux. With knob, you really have to crank on the dial to get any on screen response in linux, but with xp, every notch dials the volume slider appropriately. Damn dell…Cheers!
Jason
Thank you so much for this!!! I’ve been struggling for hours with the Xorg config trying various configurations with an extra InputDevice pointed at /dev/input/event5:
http://www.df.lth.se/~triad/krad/linuxinstall.php
This is the perfect solution!
I haven’t tried this, but I suppose you can use the following tricks to make the inputs readable by the user, and so your tool can be started by the user too:
http://ben.timby.com/?page_id=37
Thanks!
knob link returns 404
WikiErik link is dead.
http://wiki.ejohansson.se/index.php/Software/knob is now a broken link. Is there somewhere else to find the code?
Sorry for taking such a long time to respond.
The code is now here: http://git.ejohansson.se/?p=dellknob.git;a=summary
Hi Erik,
I’m happily using your utility for almost a year now and also made the recent update. Unfortunately I’m not very firm with init and always started it manually – which annoys me by now.
So I started editing the inittab but wasn’t certain about it and found dellknob-debian from gringer. Which appears to be what I want since it says something about init. But I have no idea what to do with it.
Could you please tell someone who’s well used to codes and editors but not familiar with the insides of Linux what to do or point me to the appropriate location.
regards, Sven
Sven:
Glad you like dellknob. To use the initscript you need to copy dellknob to /usr/sbin, dellknob-debian-default to /etc/default/dellknob and dellknob-debian to /etc/init.d/dellknob (make sure it’s executable). Then run “update-rc.d -n dellknob defaults” to set up the required symlinks in /etc/rc*.d.